WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/12/2011 01:55:08 AM (7 years ago)
Author:
markjaquith
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp.php

    r18467 r18541  
    201201                    if ( preg_match("#^$match#", $request_match, $matches) ||
    202202                        preg_match("#^$match#", urldecode($request_match), $matches) ) {
     203
     204                        if ( $wp_rewrite->use_verbose_page_rules && preg_match( '/pagename=\$([^&\[]+)\[([0-9]+)\]/', $query, $varmatch ) ) {
     205                            // this is a verbose page match, lets check to be sure about it
     206                            if ( ! get_page_by_path( ${$varmatch[1]}[$varmatch[2]] ) )
     207                                continue;
     208                        }
     209
    203210                        // Got a match.
    204211                        $this->matched_rule = $match;
Note: See TracChangeset for help on using the changeset viewer.