improve CSRFToken() implementation

This commit is contained in:
glaszig 2019-08-01 13:01:03 +02:00
parent 2f6dc2cc05
commit 6f1ae104f3

View file

@ -69,9 +69,8 @@ function ensureCSRFSessionToken()
*/
function CSRFToken()
{
?>
<input id="csrf_token" type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($_SESSION['csrf_token'], ENT_QUOTES); ?>" />
<?php
$token = htmlspecialchars($_SESSION['csrf_token']);
echo '<input id="csrf_token" type="hidden" name="csrf_token" value="' . $token . '">';
}
/**