diff --git wp-includes/class-wp.php wp-includes/class-wp.php
index 1217f1c..5e45ec0 100644
|
|
class WP { |
56 | 56 | public $query_string; |
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 |
62 | 62 | * @access public |
… |
… |
class WP { |
202 | 202 | // The requested permalink is in $pathinfo for path info requests and |
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; |
| 210 | $requested_path = $req_uri; |
211 | 211 | } |
| 212 | $requested_file = $req_uri; |
212 | 213 | |
213 | | $this->request = $request; |
| 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 |
219 | 220 | if ( isset( $rewrite['$'] ) ) { |
… |
… |
class WP { |
223 | 224 | } |
224 | 225 | } else { |
225 | 226 | foreach ( (array) $rewrite as $match => $query ) { |
226 | | // If the requesting file 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) || |
231 | 232 | preg_match("#^$match#", urldecode($request_match), $matches) ) { |
… |
… |
class WP { |
269 | 270 | } |
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 | |
275 | 276 | if ( isset($perma_query_vars) && strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false ) |