| 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; |
| | 188 | if ( empty( $req_uri ) ) { |
| | 189 | if ( isset( $rewrite['$'] ) ) { |
| | 190 | $this->matched_rule = '$'; |
| | 191 | $query = $rewrite['$']; |
| | 192 | $matches = array(''); |
| | 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; |
| 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; |
| | 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 | } |
| 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; |
| | 209 | if ( isset( $this->matched_rule ) ) { |
| | 210 | // Trim the query of everything up to the '?'. |
| | 211 | $query = preg_replace("!^.+\?!", '', $query); |