[wp-trac] [WordPress Trac] #3963: EP_ALL constant in wp-includes/rewrite.php doesn't encompass all values

WordPress Trac wp-trac at lists.automattic.com
Mon Mar 12 17:38:12 GMT 2007


#3963: EP_ALL constant in wp-includes/rewrite.php doesn't encompass all values
----------------------+-----------------------------------------------------
 Reporter:  jhodgdon  |       Owner:  anonymous        
     Type:  defect    |      Status:  new              
 Priority:  low       |   Milestone:  2.3              
Component:  General   |     Version:  2.1.2            
 Severity:  minor     |    Keywords:  rewrite has-patch
----------------------+-----------------------------------------------------
 In wp-includes/rewrite.php, there are a bunch of constants used in the
 add_rewrite_endpoint function (and perhaps elsewhere) to indicate which
 rewrite rules to add endpoints for. One of them, EP_ALL, looks like it was
 meant to encompass all the individual places you could add endpoints, but
 its value doesn't work. It should be 4095 instead of 255 in order to
 encompass everything.

 It is perhaps possible that the behavior was intentional, to have EP_ALL
 only stand for the constants above that are less than 255, but when I was
 writing a plugin to use the add_rewrite_endpoints, I naively first used
 EP_ALL, and then realized it didn't work for everything and substituted
 the value 4095 in my function call. So I think the name EP_ALL is
 confusing if it is not supposed to encompass everything.

 It is easy for someone calling the function to type in the value of 4095
 if they really want to get endpoints on everything, so it's a fairly low
 priority fix, but I will attach a (very simple) patch. If the 255 behavior
 was intentional and not an oversight, ignore this ticket; perhaps it would
 be nice to add a comment to the code noting that EP_ALL does not actually
 encompass everything, however.

 Also note that EP_ALL is never used in WordPress source code. But changing
 it would  affect any plugins that might have used it in their code.

 Current rewrite.php version I am referencing is [4990].

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3963>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list