!isset($_REQUEST["csrf"]) is extra fail cond

This commit is contained in:
Matt Pass
2014-05-03 14:19:24 +01:00
parent a470daf9f5
commit 8133adeab8

View File

@@ -7,7 +7,7 @@ if (!isset($_SESSION["csrf"])) {
$_SESSION["csrf"] = md5(uniqid(mt_rand(), true));
}
if (($_GET || $_POST) && $_REQUEST["csrf"] !== $_SESSION["csrf"]) {
if (($_GET || $_POST) && (!isset($_REQUEST["csrf"]) || $_REQUEST["csrf"] !== $_SESSION["csrf"])) {
die("Bad CSRF token. Please report the error info at https://github.com/mattpass/ICEcoder so it can be fixed.<br><br>
CSRF issue:<br>
REQUEST: ".$_REQUEST["csrf"]."<br>