Changeset 37356 for trunk/src/wp-includes/class-wp.php
- Timestamp:
- 05/03/2016 07:35:20 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp.php
r36900 r37356 57 57 58 58 /** 59 * Permalink or requested URI.59 * The request path, e.g. `2015/05/06`. 60 60 * 61 61 * @since 2.0.0 … … 203 203 // $req_uri for other requests. 204 204 if ( ! empty($pathinfo) && !preg_match('|^.*' . $wp_rewrite->index . '$|', $pathinfo) ) { 205 $request = $pathinfo;205 $requested_path = $pathinfo; 206 206 } else { 207 207 // If the request uri is the index, blank it out so that we don't try to match it against a rule. 208 208 if ( $req_uri == $wp_rewrite->index ) 209 209 $req_uri = ''; 210 $request = $req_uri; 211 } 212 213 $this->request = $request; 210 $requested_path = $req_uri; 211 } 212 $requested_file = $req_uri; 213 214 $this->request = $requested_path; 214 215 215 216 // Look for matches. 216 $request_match = $request ;217 $request_match = $requested_path; 217 218 if ( empty( $request_match ) ) { 218 219 // An empty request could only match against ^$ regex … … 224 225 } else { 225 226 foreach ( (array) $rewrite as $match => $query ) { 226 // If the request ingfile is the anchor of the match, prepend it to the path info.227 if ( ! empty($req _uri) && strpos($match, $req_uri) === 0 && $req_uri != $request)228 $request_match = $req _uri . '/' . $request;227 // If the requested file is the anchor of the match, prepend it to the path info. 228 if ( ! empty($requested_file) && strpos($match, $requested_file) === 0 && $requested_file != $requested_path ) 229 $request_match = $requested_file . '/' . $requested_path; 229 230 230 231 if ( preg_match("#^$match#", $request_match, $matches) || … … 270 271 271 272 // If req_uri is empty or if it is a request for ourself, unset error. 272 if ( empty($request ) || $req_uri== $self || strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false ) {273 if ( empty($requested_path) || $requested_file == $self || strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false ) { 273 274 unset( $error, $_GET['error'] ); 274 275
Note: See TracChangeset
for help on using the changeset viewer.