id summary reporter owner description type status priority milestone component version severity resolution keywords cc focuses 26037 wp_sanitize_redirect removing valid URIs characters omarabid "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-._~:/?#[]@!$&'()*+,;= }}} * http://stackoverflow.com/questions/1547899/which-characters-make-a-url-invalid/1547940#1547940 So is there are a reason to remove this characters or is this a bug?" defect (bug) closed normal Validation minor duplicate dev-feedback 2nd-opinion