Make WordPress Core


Ignore:
Timestamp:
09/14/2015 01:58:03 AM (10 years ago)
Author:
dd32
Message:

When running on windows systems, normalise the capitalisation of the drive letter for more reliable string comparisons.

Props tyxla
Fixes #33265

File:
1 edited

Legend:

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

    r34059 r34104  
    15761576 * Normalize a filesystem path.
    15771577 *
    1578  * Replaces backslashes with forward slashes for Windows systems, and ensures
    1579  * no duplicate slashes exist.
     1578 * On windows systems, replaces backslashes with forward slashes
     1579 * and forces upper-case drive letters.
     1580 * Ensures that no duplicate slashes exist.
    15801581 *
    15811582 * @since 3.9.0
     1583 * @since 4.4.0 Ensures upper-case drive letters on Windows systems.
    15821584 *
    15831585 * @param string $path Path to normalize.
     
    15871589    $path = str_replace( '\\', '/', $path );
    15881590    $path = preg_replace( '|/+|','/', $path );
     1591    if ( ':' === substr( $path, 1, 1 ) ) {
     1592        $path = ucfirst( $path );
     1593    }
    15891594    return $path;
    15901595}
Note: See TracChangeset for help on using the changeset viewer.