Refactor content-type header parsing logic#10334
Refactor content-type header parsing logic#10334mukeshpanchal27 wants to merge 1 commit intoWordPress:trunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| continue; | ||
| } | ||
|
|
||
| $name = strtolower( trim( $header_parts[0] ) ); |
There was a problem hiding this comment.
Trimming of the header name was intentionally removed in accordance of the HTTP spec
There was a problem hiding this comment.
In that case, can we add an inline comment explaining this behaviour so it doesn’t come up again in future reviews? Just curious what’s the reason behind this difference?
|
I'm not sure this is more refined? Now there are multiple |
Is there any drawback to using multiple continue statements? |
|
It's more verbose, less concise. |
Trac ticket: https://core.trac.wordpress.org/ticket/43258
Follow-up to #10293
This pull request refines the way the
wp_finalize_template_enhancement_output_bufferfunction parses and checks HTTP headers to determine the content type. The main focus is on making the header parsing more robust and accurate.Improvements to header parsing:
Content-Typeheader.Code cleanup:
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.