Fixes exception on empty token

This commit is contained in:
Samuel Georges 2017-11-02 19:52:54 +11:00
parent d164145229
commit e6de2a5521
2 changed files with 8 additions and 0 deletions

View File

@ -691,6 +691,10 @@ class Controller extends Extendable
$token = Request::input('_token') ?: Request::header('X-CSRF-TOKEN');
if (!strlen($token)) {
return false;
}
return hash_equals(
Session::token(),
$token

View File

@ -1379,6 +1379,10 @@ class Controller
$token = Request::input('_token') ?: Request::header('X-CSRF-TOKEN');
if (!strlen($token)) {
return false;
}
return hash_equals(
Session::token(),
$token