[wp-trac] [WordPress Trac] #33626: wp_favicon_request() may set a bad value for Content-Length header
WordPress Trac
noreply at wordpress.org
Mon Aug 31 15:52:48 UTC 2015
#33626: wp_favicon_request() may set a bad value for Content-Length header
--------------------------+-----------------------------
Reporter: martiusweb | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.0
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
wp_favicon_request() catches /favicon.ico requests early and sends an
empty response, avoiding the core to be loaded.
The current implementation sets the header Content-Length to 0 then exits.
However, the ob_cache will be flushed and may sent data (for instance, a
BOM - Byte Order Mark left in wp-config.php).
With Apache 2.2 and probably several other common servers implementations
(including nginx), it lead to a bad response, since the client should not
expect a body but will receive the 3 bytes of the BOM. Some proxies might
get confused.
This can be fixed by calling ob_clean() or ob_end_clean() in
wp_favicon_request().
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33626>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list