Should PHP header locations be encoded?
header("Location: ".$_SERVER["REQUEST_URI"]);
header("Location: ".rawurlencode($_SERVER["REQUEST_URI"]));
If so, why, when, and how?
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)