mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Fixes exception on empty token
This commit is contained in:
parent
d164145229
commit
e6de2a5521
@ -691,6 +691,10 @@ class Controller extends Extendable
|
|||||||
|
|
||||||
$token = Request::input('_token') ?: Request::header('X-CSRF-TOKEN');
|
$token = Request::input('_token') ?: Request::header('X-CSRF-TOKEN');
|
||||||
|
|
||||||
|
if (!strlen($token)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return hash_equals(
|
return hash_equals(
|
||||||
Session::token(),
|
Session::token(),
|
||||||
$token
|
$token
|
||||||
|
@ -1379,6 +1379,10 @@ class Controller
|
|||||||
|
|
||||||
$token = Request::input('_token') ?: Request::header('X-CSRF-TOKEN');
|
$token = Request::input('_token') ?: Request::header('X-CSRF-TOKEN');
|
||||||
|
|
||||||
|
if (!strlen($token)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return hash_equals(
|
return hash_equals(
|
||||||
Session::token(),
|
Session::token(),
|
||||||
$token
|
$token
|
||||||
|
Loading…
x
Reference in New Issue
Block a user