Eliminated warning

master
Brady McDonough 2 years ago
parent 4403caeb41
commit abbf712900

@ -23,9 +23,9 @@ class Base implements AntiCSRFInterface
/** @SuppressWarnings(PHPMD.Superglobals) */
public function match(): bool
{
$request_token = $_REQUEST[self::CSRF_TOKEN_IDX];
$request_token = $_REQUEST[self::CSRF_TOKEN_IDX] ?? false;
if (!is_null($request_token) && \hash_equals($this->token, $request_token))
if ($request_token && \hash_equals($this->token, $request_token))
{
return !$this->expired();
}

Loading…
Cancel
Save