Changeset 18466 for trunk/wp-includes/class-wp.php
- Timestamp:
- 07/25/2011 08:18:07 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp.php
r18192 r18466 186 186 // Look for matches. 187 187 $request_match = $request; 188 foreach ( (array) $rewrite as $match => $query) { 189 // Don't try to match against AtomPub calls 190 if ( $req_uri == 'wp-app.php' ) 191 break; 192 193 // If the requesting file is the anchor of the match, prepend it 194 // to the path info. 195 if ( (! empty($req_uri)) && (strpos($match, $req_uri) === 0) && ($req_uri != $request) ) 196 $request_match = $req_uri . '/' . $request; 197 198 if ( preg_match("#^$match#", $request_match, $matches) || 199 preg_match("#^$match#", urldecode($request_match), $matches) ) { 200 // Got a match. 201 $this->matched_rule = $match; 202 203 // Trim the query of everything up to the '?'. 204 $query = preg_replace("!^.+\?!", '', $query); 205 206 // Substitute the substring matches into the query. 207 $query = addslashes(WP_MatchesMapRegex::apply($query, $matches)); 208 209 $this->matched_query = $query; 210 211 // Parse the query. 212 parse_str($query, $perma_query_vars); 213 214 // If we're processing a 404 request, clear the error var 215 // since we found something. 216 if ( isset($_GET['error']) ) 217 unset($_GET['error']); 218 219 if ( isset($error) ) 220 unset($error); 221 222 break; 188 if ( empty( $req_uri ) ) { 189 if ( isset( $rewrite['$'] ) ) { 190 $this->matched_rule = '$'; 191 $query = $rewrite['$']; 192 $matches = array(''); 223 193 } 194 } else if ( $req_uri != 'wp-app.php' ) { 195 foreach ( (array) $rewrite as $match => $query ) { 196 // If the requesting file is the anchor of the match, prepend it to the path info. 197 if ( ! empty($req_uri) && strpos($match, $req_uri) === 0 && $req_uri != $request ) 198 $request_match = $req_uri . '/' . $request; 199 200 if ( preg_match("#^$match#", $request_match, $matches) || 201 preg_match("#^$match#", urldecode($request_match), $matches) ) { 202 // Got a match. 203 $this->matched_rule = $match; 204 break; 205 } 206 } 207 } 208 209 if ( isset( $this->matched_rule ) ) { 210 // Trim the query of everything up to the '?'. 211 $query = preg_replace("!^.+\?!", '', $query); 212 213 // Substitute the substring matches into the query. 214 $query = addslashes(WP_MatchesMapRegex::apply($query, $matches)); 215 216 $this->matched_query = $query; 217 218 // Parse the query. 219 parse_str($query, $perma_query_vars); 220 221 // If we're processing a 404 request, clear the error var 222 // since we found something. 223 unset( $_GET['error'] ); 224 unset( $error ); 224 225 } 225 226 226 227 // If req_uri is empty or if it is a request for ourself, unset error. 227 228 if ( empty($request) || $req_uri == $self || strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false ) { 228 if ( isset($_GET['error']) ) 229 unset($_GET['error']); 230 231 if ( isset($error) ) 232 unset($error); 229 unset( $_GET['error'] ); 230 unset( $error ); 233 231 234 232 if ( isset($perma_query_vars) && strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false ) 235 unset( $perma_query_vars);233 unset( $perma_query_vars ); 236 234 237 235 $this->did_permalink = false;
Note: See TracChangeset
for help on using the changeset viewer.