Ticket #20750: 20750.2.patch

File 20750.2.patch, 1015 bytes (added by SergeyBiryukov, 12 months ago)
  • wp-includes/link-template.php

     
    18731873 
    18741874        if ( 'relative' == $scheme ) 
    18751875                $url = preg_replace( '#^.+://[^/]*#', '', $url ); 
    1876         elseif ( 'http' != $scheme ) 
    1877                 $url = str_replace( 'http://', "$scheme://", $url ); 
     1876        else 
     1877                $url = str_replace( array( 'http://', 'https://' ), "$scheme://", $url ); 
    18781878 
    18791879        if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false ) 
    18801880                $url .= '/' . ltrim( $path, '/' ); 
     
    19381938 
    19391939        if ( 'relative' == $scheme ) 
    19401940                $url = preg_replace( '#^.+://[^/]*#', '', $url ); 
    1941         elseif ( 'http' != $scheme ) 
    1942                 $url = str_replace( 'http://', "{$scheme}://", $url ); 
     1941        else 
     1942                $url = str_replace( array( 'http://', 'https://' ), "$scheme://", $url ); 
    19431943 
    19441944        if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false ) 
    19451945                $url .= '/' . ltrim( $path, '/' );