From 24c2774076b48d9bdfa95ffbb02c1f4e44effd40 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Thu, 7 Nov 2013 03:33:11 +0000 Subject: [PATCH] Fix a case where wp_guess_url() would leave a prefixed path in the generated URL when symlinks were involved. Fixes #25797 git-svn-id: https://develop.svn.wordpress.org/trunk@26031 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 754353878f..7d931bc6ea 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -3254,7 +3254,7 @@ function wp_guess_url() { $path = preg_replace( '#/' . preg_quote( $directory, '#' ) . '/[^/]*$#i', '' , $_SERVER['REQUEST_URI'] ); } elseif ( false !== strpos( $abspath_fix, $script_filename_dir ) ) { // Request is hitting a file above ABSPATH - $subdirectory = str_replace( $script_filename_dir, '', $abspath_fix ); + $subdirectory = substr( $abspath_fix, strpos( $abspath_fix, $script_filename_dir ) + strlen( $script_filename_dir ) ); // Strip off any file/query params from the path, appending the sub directory to the install $path = preg_replace( '#/[^/]*$#i', '' , $_SERVER['REQUEST_URI'] ) . $subdirectory; } else {