[wp-trac] [WordPress Trac] #9824: make better use of stubs when verbose rules should apply

WordPress Trac wp-trac at lists.automattic.com
Sat Oct 23 00:14:46 UTC 2010


#9824: make better use of stubs when verbose rules should apply
-------------------------------+--------------------------------------------
 Reporter:  Denis-de-Bernardy  |       Owner:                
     Type:  enhancement        |      Status:  assigned      
 Priority:  normal             |   Milestone:  Future Release
Component:  Optimization       |     Version:                
 Severity:  normal             |    Keywords:  needs-patch   
-------------------------------+--------------------------------------------

Comment(by Ryan_B):

 In wp-includes/rewrite.php on line 1984.

 change code to {{{if (
 preg_match("#\A/%(?:postname|category|tag|author)%#",
 $this->permalink_structure) )}}}

 Works on my test.  It appears the current regular expression returns looks
 at the first wildcard and if it is postname, category, tag, or author
 returns true, forcing verbose page rules.  However per discussion on wp-
 hackers mailing list verbose page rules need not apply in all cases where
 one of those items is the first wildcard, if preceeded by a static string,
 such as /blog/%pagename%.  My new regular expression specifically looks at
 the first element in the path and if it is one of those 4 wildcards
 returns true, otherwise if its some other wildcard or a string like
 /blog/... returns false ensuring verbose page rules are set only when
 absolutley necessary.

 Sorry I was unable to provide a .diff for this, I could not get the
 current code to checkout from subversion, some error I have been unable to
 resolve, so since its a minor fix figured i'd just include it as a comment
 here to be included in next release hopefully.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9824#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list