Fix #1966 warning in PHP 8.0

This commit is contained in:
Kijin Sung 2022-06-29 19:48:44 +09:00
parent 34cd3ebf66
commit 34517e83ce

View file

@ -330,11 +330,11 @@ class Security
*/
public static function checkCSRF($referer = null)
{
if ($token = $_SERVER['HTTP_X_CSRF_TOKEN'])
if ($token = isset($_SERVER['HTTP_X_CSRF_TOKEN']) ? $_SERVER['HTTP_X_CSRF_TOKEN'] : null)
{
return Session::verifyToken($token);
}
elseif ($token = $_REQUEST['_rx_csrf_token'])
elseif ($token = isset($_REQUEST['_rx_csrf_token']) ? $_REQUEST['_rx_csrf_token'] : null)
{
return Session::verifyToken($token);
}