diff --git a/app/Http/Middleware/VerifyReCaptcha.php b/app/Http/Middleware/VerifyReCaptcha.php index 75a9871a5..1464cc5de 100644 --- a/app/Http/Middleware/VerifyReCaptcha.php +++ b/app/Http/Middleware/VerifyReCaptcha.php @@ -39,9 +39,11 @@ class VerifyReCaptcha $url = parse_url($request->url()); - if (array_key_exists('host', $url)) { - return $result->hostname === $url['host']; + if (! array_key_exists('host', $url)) { + return false; } + + return $result->hostname === $url['host'];; }; if ($result->success && (! config('recaptcha.verify_domain') || $verified($result, $request))) {