Make WordPress Core


Ignore:
Timestamp:
10/08/2014 06:43:14 AM (11 years ago)
Author:
dd32
Message:

Avoid a PHP Notice when requesting a url without a path component (http://example.com) in the Streams HTTP component.
Props barrykooij for inital patch; Fixes #27668

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-http.php

    r29852 r29853  
    862862        }
    863863
     864        // Always pass a Path, defaulting to the root in cases such as http://example.com
     865        if ( ! isset( $arrURL['path'] ) ) {
     866            $arrURL['path'] = '/';
     867        }
     868
    864869        if ( isset( $r['headers']['Host'] ) || isset( $r['headers']['host'] ) ) {
    865870            if ( isset( $r['headers']['Host'] ) )
     
    965970        else
    966971            $requestPath = $arrURL['path'] . ( isset($arrURL['query']) ? '?' . $arrURL['query'] : '' );
    967 
    968         if ( empty($requestPath) )
    969             $requestPath .= '/';
    970972
    971973        $strHeaders = strtoupper($r['method']) . ' ' . $requestPath . ' HTTP/' . $r['httpversion'] . "\r\n";
Note: See TracChangeset for help on using the changeset viewer.