[wp-trac] [WordPress Trac] #18991: Unnecessarily cryptic code when checking pagename= for verbose rules

WordPress Trac wp-trac at lists.automattic.com
Tue Oct 18 21:19:45 UTC 2011


#18991: Unnecessarily cryptic code when checking pagename= for verbose rules
--------------------------+------------------
 Reporter:  duck_         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.3
Component:  General       |     Version:  3.3
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------

Comment (by duck_):

 Reply got delayed until after your 2nd one, but will post anyway.

 Replying to [comment:1 Otto42]:
 > Maybe I'm being overly cautious?

 The variable variable doesn't make sense if it's not "matches" as there's
 no other array to use.

 As for the regular expression. If the query is not pagename=$matches[n]
 then it's not going to be used by WP_MatchesMapRegex anyway since
 WP_MatchesMapRegex::$_pattern is `'(\$matches\[[1-9]+[0-9]*\])'`.

 I wasn't sure about this at first too. I even followed the code back to
 [881] to see if a different variable name was ever useful/worked here.

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


More information about the wp-trac mailing list