Make WordPress Core

Ticket #42837: wp_normalize_path.diff

File wp_normalize_path.diff, 632 bytes (added by calin, 8 years ago)
  • wp-includes/functions.php

    diff -Naur wordpress-orig/wp-includes/functions.php wordpress/wp-includes/functions.php
    old new  
    17091709 * @return string Normalized path.
    17101710 */
    17111711function wp_normalize_path( $path ) {
     1712        $wrapper = '';
     1713        if ( wp_is_stream( $path ) ) {
     1714                list( $wrapper, $path ) = explode( '://', $path, 2 );
     1715                $wrapper .= '://';
     1716        }
    17121717        $path = str_replace( '\\', '/', $path );
    17131718        $path = preg_replace( '|(?<=.)/+|', '/', $path );
    17141719        if ( ':' === substr( $path, 1, 1 ) ) {
    17151720                $path = ucfirst( $path );
    17161721        }
    1717         return $path;
     1722        return $wrapper . $path;
    17181723}
    17191724
    17201725/**