Fixed possible NULL in CSRF check.

This commit is contained in:
flash 2023-07-12 19:14:40 +00:00
parent 29165de457
commit 9b65ce005a

View file

@ -19,9 +19,9 @@ final class CSRF {
}
public static function validateRequest(int $tolerance = -1): bool {
$token = filter_input(INPUT_POST, '_csrf');
$token = (string)filter_input(INPUT_POST, '_csrf');
if(empty($token))
$token = filter_input(INPUT_GET, 'csrf');
$token = (string)filter_input(INPUT_GET, 'csrf');
return self::$instance->verifyToken($token, $tolerance);
}