From f196a4932c82f08384f7f9acc843ff4c39928603 Mon Sep 17 00:00:00 2001 From: scribu Date: Wed, 27 Oct 2010 00:25:03 +0000 Subject: [PATCH] Don't trigger verbose page rules if permalink begins with fixed string. Fixes #9824 git-svn-id: https://develop.svn.wordpress.org/trunk@15987 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/rewrite.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index 418cc7484d..96e56f9fb8 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -1904,19 +1904,17 @@ class WP_Rewrite { $this->root = ''; if ( $this->using_index_permalinks() ) $this->root = $this->index . '/'; + unset($this->author_structure); unset($this->date_structure); unset($this->page_structure); unset($this->search_structure); unset($this->feed_structure); unset($this->comment_feed_structure); + $this->use_trailing_slashes = ( '/' == substr($this->permalink_structure, -1, 1) ); - // Enable generic rules for pages if permalink structure doesn't begin with a wildcard. - if ( preg_match("/^[^%]*%(?:postname|category|tag|author)%/", $this->permalink_structure) ) - $this->use_verbose_page_rules = true; - else - $this->use_verbose_page_rules = false; + $this->use_verbose_page_rules = preg_match( "#^/%(postname|category|tag|author)%#", $this->permalink_structure ); } /**