Ticket #25317: 25317.patch
File 25317.patch, 2.1 KB (added by , 12 years ago) |
---|
-
src/wp-includes/functions.php
3233 3233 if ( defined('WP_SITEURL') && '' != WP_SITEURL ) { 3234 3234 $url = WP_SITEURL; 3235 3235 } else { 3236 $abspath_fix = str_replace( '\\', '/', ABSPATH ); 3237 $script_filename_dir = dirname( $_SERVER['SCRIPT_FILENAME'] ); 3238 3236 3239 // The request is for the admin 3237 3240 if ( strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) !== false || strpos( $_SERVER['REQUEST_URI'], 'wp-login.php' ) !== false ) { 3238 3241 $path = preg_replace( '#/(wp-admin/.*|wp-login.php)#i', '', $_SERVER['REQUEST_URI'] ); 3239 3242 3240 3243 // The request is for a file in ABSPATH 3241 } elseif ( dirname( $_SERVER['SCRIPT_FILENAME'] ) . '/' == ABSPATH) {3244 } elseif ( $script_filename_dir . '/' == $abspath_fix ) { 3242 3245 // Strip off any file/query params in the path 3243 3246 $path = preg_replace( '#/[^/]*$#i', '', $_SERVER['PHP_SELF'] ); 3244 3247 3245 3248 } else { 3246 if ( false !== strpos( $_SERVER['SCRIPT_FILENAME'], ABSPATH) ) {3249 if ( false !== strpos( $_SERVER['SCRIPT_FILENAME'], $abspath_fix ) ) { 3247 3250 // Request is hitting a file inside ABSPATH 3248 $directory = str_replace( ABSPATH, '', dirname( $_SERVER['SCRIPT_FILENAME'] ));3251 $directory = str_replace( ABSPATH, '', $script_filename_dir ); 3249 3252 // Strip off the sub directory, and any file/query paramss 3250 3253 $path = preg_replace( '#/' . preg_quote( $directory, '#' ) . '/[^/]*$#i', '' , $_SERVER['REQUEST_URI'] ); 3251 } else {3254 } elseif ( false !== strpos( $abspath_fix, $script_filename_dir ) ) { 3252 3255 // Request is hitting a file above ABSPATH 3253 $subdirectory = str_replace( dirname( $_SERVER['SCRIPT_FILENAME'] ), '', ABSPATH);3256 $subdirectory = str_replace( $script_filename_dir, '', $abspath_fix ); 3254 3257 // Strip off any file/query params from the path, appending the sub directory to the install 3255 3258 $path = preg_replace( '#/[^/]*$#i', '' , $_SERVER['REQUEST_URI'] ) . $subdirectory; 3259 } else { 3260 $path = preg_replace( '#/(wp-admin/.*|wp-login.php)#i', '', $_SERVER['REQUEST_URI'] ); 3256 3261 } 3257 3262 } 3258 3263