[wp-trac] [WordPress Trac] #36253: Host header should not include port in WP_Http_Streams
WordPress Trac
noreply at wordpress.org
Wed Mar 16 13:13:01 UTC 2016
#36253: Host header should not include port in WP_Http_Streams
--------------------------+------------------------------
Reporter: bangelov | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: HTTP API | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by bangelov):
I am adding new and better solution on the problem because if Host header
contain IPv6 the above logic will fail
{{{#!php
<?php
if ( isset( $r['headers']['Host'] ) || isset( $r['headers']['host'] ) ) {
if ( isset( $r['headers']['Host'] ) )
$arrURL['host'] = preg_replace( '/:\d+$/', '',
$r['headers']['Host'] );
else
$arrURL['host'] = preg_replace( '/:\d+$/', '',
$r['headers']['host'] );
unset( $r['headers']['Host'], $r['headers']['host'] );
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36253#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list