Opened 13 years ago
Closed 13 years ago
#26037 closed defect (bug) (duplicate)
wp_sanitize_redirect removing valid URIs characters
| Reported by: | omarabid | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Validation | Version: | |
| Severity: | minor | Keywords: | dev-feedback 2nd-opinion |
| Cc: | Focuses: |
Description
I'm using the wp_redirect function on one of my plugins. One of my users found out that in the redirect, the brackets are removed from the URL.
I dug a little bit and found the culprit to be the function "wp_sanitize_redirect" which removes the brackets.
Here is the regex expression that detects and removes unwanted characters
$location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%!]|i', '', $location);
Here are the accepted characters in a URI*
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~:/?#[]@!$&'()*+,;=
So is there are a reason to remove this characters or is this a bug?
Change History (1)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Duplicate of #17052.