Make WordPress Core

Ticket #37991: fsockopen.php.patch

File fsockopen.php.patch, 748 bytes (added by amandato, 8 years ago)

Patch for setting host: without port for http and https when default port is used

Line 
1173,175c173,181
2<
3<                       if ($url_parts['port'] !== 80) {
4<                               $out .= ':' . $url_parts['port'];
5---
6>                       
7>                       if( !empty($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'http' && $url_parts['port'] !== 80 ) {
8>                               $out .= ':' . $url_parts['port']; // Handle custom http scheme port
9>                       }
10>                       else if( !empty($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https' && $url_parts['port'] !== 443 ) {
11>                               $out .= ':' . $url_parts['port']; // Handle custom https scheme port
12>                       }
13>                       else if( empty($url_parts['scheme']) || strtolower($url_parts['scheme']) !== 'http' || strtolower( $url_parts['scheme']) !== 'https' ) {
14>                               $out .= ':' . $url_parts['port']; // specify port when scheme is unknown