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

Props tyxla
Fixes #33265

Built from https://develop.svn.wordpress.org/trunk@34104


git-svn-id: http://core.svn.wordpress.org/trunk@34072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2015-09-14 01:59:25 +00:00
parent bae7312f03
commit 476b5c2046
2 changed files with 8 additions and 3 deletions

View File

@ -1575,10 +1575,12 @@ function path_join( $base, $path ) {
/**
* Normalize a filesystem path.
*
* Replaces backslashes with forward slashes for Windows systems, and ensures
* no duplicate slashes exist.
* On windows systems, replaces backslashes with forward slashes
* and forces upper-case drive letters.
* Ensures that no duplicate slashes exist.
*
* @since 3.9.0
* @since 4.4.0 Ensures upper-case drive letters on Windows systems.
*
* @param string $path Path to normalize.
* @return string Normalized path.
@ -1586,6 +1588,9 @@ function path_join( $base, $path ) {
function wp_normalize_path( $path ) {
$path = str_replace( '\\', '/', $path );
$path = preg_replace( '|/+|','/', $path );
if ( ':' === substr( $path, 1, 1 ) ) {
$path = ucfirst( $path );
}
return $path;
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-34103';
$wp_version = '4.4-alpha-34104';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.