Changeset 18541 for trunk/wp-includes/rewrite.php
- Timestamp:
- 08/12/2011 01:55:08 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/rewrite.php
r18540 r18541 307 307 $request_match = $request; 308 308 foreach ( (array)$rewrite as $match => $query) { 309 309 310 // If the requesting file is the anchor of the match, prepend it 310 311 // to the path info. … … 313 314 314 315 if ( preg_match("!^$match!", $request_match, $matches) ) { 316 317 if ( $wp_rewrite->use_verbose_page_rules && preg_match( '/pagename=\$([^&\[]+)\[([0-9]+)\]/', $query, $varmatch ) ) { 318 // this is a verbose page match, lets check to be sure about it 319 if ( ! get_page_by_path( ${$varmatch[1]}[$varmatch[2]] ) ) 320 continue; 321 } 322 315 323 // Got a match. 316 324 // Trim the query of everything up to the '?'. … … 814 822 $page_structure = $this->get_page_permastruct(); 815 823 816 if ( ! $this->use_verbose_page_rules ) { 817 $this->add_rewrite_tag('%pagename%', "(.+?)", 'pagename='); 818 $rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure, EP_PAGES)); 819 return $rewrite_rules; 820 } 821 822 $page_uris = $this->page_uri_index(); 823 $uris = $page_uris[0]; 824 $attachment_uris = $page_uris[1]; 825 826 if ( is_array( $attachment_uris ) ) { 827 foreach ( $attachment_uris as $uri => $pagename ) { 828 $this->add_rewrite_tag('%pagename%', "($uri)", 'attachment='); 829 $rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure, EP_PAGES)); 830 } 831 } 832 if ( is_array( $uris ) ) { 833 foreach ( $uris as $uri => $pagename ) { 834 $this->add_rewrite_tag('%pagename%', "($uri)", 'pagename='); 835 $rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure, EP_PAGES)); 836 } 837 } 838 824 // the extra .? at the beginning prevents clashes with other regex's in thie structure 825 $this->add_rewrite_tag('%pagename%', "(.?.+?)", 'pagename='); 826 $rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure, EP_PAGES)); 839 827 return $rewrite_rules; 840 828 } … … 1554 1542 // Put them together. 1555 1543 if ( $this->use_verbose_page_rules ) 1556 $this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $old_feed_files, $registration_pages, $ page_rewrite, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $this->extra_rules);1544 $this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $old_feed_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $page_rewrite, $post_rewrite, $this->extra_rules); 1557 1545 else 1558 1546 $this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $old_feed_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules);
Note: See TracChangeset
for help on using the changeset viewer.