From 6a23a0ddd5fc690121701b08891d86c2a66d8734 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Tue, 8 Mar 2016 06:00:26 +0000 Subject: [PATCH] Filesystem: Support Windows shares/DFS roots in `wp_normalize_path()`. Props rilwis for initial patch. Fixes #35996. Built from https://develop.svn.wordpress.org/trunk@36881 git-svn-id: http://core.svn.wordpress.org/trunk@36848 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 6 ++++-- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index bcd56f748d..7d4a51f939 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1687,17 +1687,19 @@ function path_join( $base, $path ) { * * On windows systems, replaces backslashes with forward slashes * and forces upper-case drive letters. - * Ensures that no duplicate slashes exist. + * Allows for two leading slashes for Windows network shares, but + * ensures that all other duplicate slashes are reduced to a single. * * @since 3.9.0 * @since 4.4.0 Ensures upper-case drive letters on Windows systems. + * @since 4.5.0 Allows for Windows network shares. * * @param string $path Path to normalize. * @return string Normalized path. */ function wp_normalize_path( $path ) { $path = str_replace( '\\', '/', $path ); - $path = preg_replace( '|/+|','/', $path ); + $path = preg_replace( '|(?<=.)/+|', '/', $path ); if ( ':' === substr( $path, 1, 1 ) ) { $path = ucfirst( $path ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index f812304751..8e449dc8e6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-beta2-36880'; +$wp_version = '4.5-beta2-36881'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.