Eliminate verbose rewrite rules for ambiguous rewrite structures, resulting in massive performance gains. props andy, otto42, duck_. Nice work everyone! see #16687

git-svn-id: https://develop.svn.wordpress.org/trunk@18541 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith
2011-08-12 01:55:08 +00:00
parent c8412b5037
commit 48d294e7ea
3 changed files with 52 additions and 46 deletions
+7
View File
@@ -200,6 +200,13 @@ class WP {
if ( preg_match("#^$match#", $request_match, $matches) ||
preg_match("#^$match#", urldecode($request_match), $matches) ) {
if ( $wp_rewrite->use_verbose_page_rules && preg_match( '/pagename=\$([^&\[]+)\[([0-9]+)\]/', $query, $varmatch ) ) {
// this is a verbose page match, lets check to be sure about it
if ( ! get_page_by_path( ${$varmatch[1]}[$varmatch[2]] ) )
continue;
}
// Got a match.
$this->matched_rule = $match;
break;