Make WordPress Core


Ignore:
Timestamp:
03/08/2016 05:59:45 AM (8 years ago)
Author:
dd32
Message:

Filesystem: Support Windows shares/DFS roots in wp_normalize_path().

Props rilwis for initial patch.
Fixes #35996.

File:
1 edited

Legend:

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

    r36644 r36881  
    16881688 * On windows systems, replaces backslashes with forward slashes
    16891689 * and forces upper-case drive letters.
    1690  * Ensures that no duplicate slashes exist.
     1690 * Allows for two leading slashes for Windows network shares, but
     1691 * ensures that all other duplicate slashes are reduced to a single.
    16911692 *
    16921693 * @since 3.9.0
    16931694 * @since 4.4.0 Ensures upper-case drive letters on Windows systems.
     1695 * @since 4.5.0 Allows for Windows network shares.
    16941696 *
    16951697 * @param string $path Path to normalize.
     
    16981700function wp_normalize_path( $path ) {
    16991701    $path = str_replace( '\\', '/', $path );
    1700     $path = preg_replace( '|/+|','/', $path );
     1702    $path = preg_replace( '|(?<=.)/+|', '/', $path );
    17011703    if ( ':' === substr( $path, 1, 1 ) ) {
    17021704        $path = ucfirst( $path );
Note: See TracChangeset for help on using the changeset viewer.