Should PHP header locations be encoded?
header("Location: ".$_SERVER["REQUEST_URI"]);
header("Location: ".rawurlencode($_SERVER["REQUEST_URI"]));
If so, why, when, and how?
You only need to encode it, if you have some special chars (defined in RFC1806) in your URL. Especially you should encode all URLs with the following characters: {}|\^~[]` (as of RFC1738)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With