Opened 19 years ago
Closed 19 years ago
#3963 closed defect (bug) (fixed)
EP_ALL constant in wp-includes/rewrite.php doesn't encompass all values
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 2.2 | Priority: | low |
| Severity: | minor | Version: | 2.1.2 |
| Component: | General | Keywords: | rewrite has-patch |
| Focuses: | Cc: |
Description
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].
Patch to change the value of EP_ALL to 4095