Opened 16 years ago
Closed 16 years ago
#7486 closed enhancement (fixed)
When looking for rewrite rules matches, change preg_match start/end character from ! to % or #
Reported by: | aesqe | Owned by: | jacobsantos |
---|---|---|---|
Milestone: | 2.8 | Priority: | lowest |
Severity: | trivial | Version: | 2.6 |
Component: | General | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
In classes.php, around line 100 (lines 104 and 105 in WP 2.6, class WP) when trying to find rewrite rule matches, ! (exclamation mark) is used as start/end for regexp in the preg_match function. Should be changed to % or # to enable use of, for example, (?!) in rules.
Attachments (2)
Change History (9)
#1
@
16 years ago
- Keywords has-patch commit needs-testing added; regexp rewrite rules removed
- Milestone changed from 2.9 to 2.8
Has patch, sending to 2.8.
#2
follow-up:
↓ 3
@
16 years ago
- Keywords needs-patch added; has-patch commit needs-testing removed
- Version set to 2.6
preg_quote() is not the answer, that escapes all content within it, so as to render any rules useless.
would anyone have a need to use # in a rewrite rule?
#3
in reply to:
↑ 2
@
16 years ago
Replying to DD32:
would anyone have a need to use # in a rewrite rule?
Only if you were doing non-escaped redirection on an anchor. I guess it would be pretty rare.
#4
@
16 years ago
Only if you were doing non-escaped redirection on an anchor. I guess it would be pretty rare.
Does the Anchor even get sent -to- the server? I dont think it does?
Eitherway, It needs to use something as a delim. I would think # wouldnt be used within a URL (assuming its not sent to the server, and i'm pretty sure it isnt) in order to prevent confusing browsers, else it'd have to be escaped.. and that would just be plain ugly..
Patch is based off of r10258