Skip to content

Commit 1a85a1d

Browse files
committed
Display a more helpful & useful error message
1 parent ab8ad37 commit 1a85a1d

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

lib/headers.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@
88
}
99

1010
if (($_GET || $_POST) && $_REQUEST["csrf"] !== $_SESSION["csrf"]) {
11-
echo '<script>alert("Bad CSRF token. Please press F12, view the console and report the error, including file & line number, so it can be fixed. Many thanks!");</script>';
12-
echo '<script>console.log("CSRF issue: REQUEST: "+$_REQUEST["csrf"]+", SESSION: "+$_SESSION["csrf"]);</script>';
13-
die('Bad CSRF token');
11+
die("Bad CSRF token. Please report the error info at https://github.com/mattpass/ICEcoder so it can be fixed.<br><br>
12+
CSRF issue:<br>
13+
REQUEST: ".$_REQUEST["csrf"]."<br>
14+
SESSION: ".$_SESSION["csrf"]."<br>
15+
FILE: ".$_SERVER["SCRIPT_NAME"]."<br>
16+
GET: ".var_export($_GET, true)."<br>
17+
POST: ".var_export($_POST, true)."<br>
18+
<br>Many thanks!");
1419
}
1520

1621
// Set our security related headers

0 commit comments

Comments
 (0)