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:
parent
bae7312f03
commit
476b5c2046
|
@ -1575,10 +1575,12 @@ function path_join( $base, $path ) {
|
||||||
/**
|
/**
|
||||||
* Normalize a filesystem path.
|
* Normalize a filesystem path.
|
||||||
*
|
*
|
||||||
* Replaces backslashes with forward slashes for Windows systems, and ensures
|
* On windows systems, replaces backslashes with forward slashes
|
||||||
* no duplicate slashes exist.
|
* and forces upper-case drive letters.
|
||||||
|
* Ensures that no duplicate slashes exist.
|
||||||
*
|
*
|
||||||
* @since 3.9.0
|
* @since 3.9.0
|
||||||
|
* @since 4.4.0 Ensures upper-case drive letters on Windows systems.
|
||||||
*
|
*
|
||||||
* @param string $path Path to normalize.
|
* @param string $path Path to normalize.
|
||||||
* @return string Normalized path.
|
* @return string Normalized path.
|
||||||
|
@ -1586,6 +1588,9 @@ function path_join( $base, $path ) {
|
||||||
function wp_normalize_path( $path ) {
|
function wp_normalize_path( $path ) {
|
||||||
$path = str_replace( '\\', '/', $path );
|
$path = str_replace( '\\', '/', $path );
|
||||||
$path = preg_replace( '|/+|','/', $path );
|
$path = preg_replace( '|/+|','/', $path );
|
||||||
|
if ( ':' === substr( $path, 1, 1 ) ) {
|
||||||
|
$path = ucfirst( $path );
|
||||||
|
}
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue