Fixed possible NULL in CSRF check.
This commit is contained in:
parent
29165de457
commit
9b65ce005a
1 changed files with 2 additions and 2 deletions
|
@ -19,9 +19,9 @@ final class CSRF {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function validateRequest(int $tolerance = -1): bool {
|
public static function validateRequest(int $tolerance = -1): bool {
|
||||||
$token = filter_input(INPUT_POST, '_csrf');
|
$token = (string)filter_input(INPUT_POST, '_csrf');
|
||||||
if(empty($token))
|
if(empty($token))
|
||||||
$token = filter_input(INPUT_GET, 'csrf');
|
$token = (string)filter_input(INPUT_GET, 'csrf');
|
||||||
|
|
||||||
return self::$instance->verifyToken($token, $tolerance);
|
return self::$instance->verifyToken($token, $tolerance);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue