Changeset 25396 for trunk/src/wp-includes/functions.php
- Timestamp:
- 09/12/2013 06:56:20 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r25371 r25396 3232 3232 $url = WP_SITEURL; 3233 3233 } else { 3234 // The request is for the admin 3235 if ( strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) !== false || strpos( $_SERVER['REQUEST_URI'], 'wp-login.php' ) !== false ) { 3236 $path = preg_replace( '#/(wp-admin/.*|wp-login.php)#i', '', $_SERVER['REQUEST_URI'] ); 3237 3238 // The request is for a file in ABSPATH 3239 } elseif ( dirname( $_SERVER['SCRIPT_FILENAME'] ) . '/' == ABSPATH ) { 3240 // Strip off any file/query params in the path 3241 $path = preg_replace( '#/[^/]*$#i', '', $_SERVER['PHP_SELF'] ); 3242 3243 } else { 3244 if ( false !== strpos( $_SERVER['SCRIPT_FILENAME'], ABSPATH ) ) { 3245 // Request is hitting a file inside ABSPATH 3246 $directory = str_replace( ABSPATH, '', dirname( $_SERVER['SCRIPT_FILENAME'] ) ); 3247 // Strip off the sub directory, and any file/query paramss 3248 $path = preg_replace( '#/' . preg_quote( $directory, '#' ) . '/[^/]*$#i', '' , $_SERVER['REQUEST_URI'] ); 3249 } else { 3250 // Request is hitting a file above ABSPATH 3251 $subdirectory = str_replace( dirname( $_SERVER['SCRIPT_FILENAME'] ), '', ABSPATH ); 3252 // Strip off any file/query params from the path, appending the sub directory to the install 3253 $path = preg_replace( '#/[^/]*$#i', '' , $_SERVER['REQUEST_URI'] ) . $subdirectory; 3254 } 3255 } 3256 3234 3257 $schema = is_ssl() ? 'https://' : 'http://'; // set_url_scheme() is not defined yet 3235 $url = preg_replace( '#/(wp-admin/.*|wp-login.php)#i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );3258 $url = $schema . $_SERVER['HTTP_HOST'] . $path; 3236 3259 } 3237 3260
Note: See TracChangeset
for help on using the changeset viewer.