mirror of
https://github.com/php/web-php.git
synced 2026-03-23 23:02:13 +01:00
Prevent response header splitting
This commit is contained in:
@@ -11,7 +11,7 @@ $abs = $pwd. "/" .(string)$_GET["f"];
|
||||
$abs = realpath($abs);
|
||||
|
||||
if (strncmp($abs, $pwd, strlen($pwd)) != 0) {
|
||||
header("Location: http://php.net/" . $_GET["f"]);
|
||||
header("Location: http://php.net/" . strtr($_GET["f"],array("\r"=>"","\n"=>"")));
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
|
||||
|
||||
$page = isset($_GET['page']) ? htmlspecialchars($_GET['page'], ENT_QUOTES, 'UTF-8') : '';
|
||||
$page = strtr($page, array("\r"=>"","\n"=>""));
|
||||
|
||||
// Redirect to new manual page
|
||||
mirror_redirect("/manual/" . $page);
|
||||
?>
|
||||
Reference in New Issue
Block a user