diff --git a/src/PhoneDetector.php b/src/PhoneDetector.php index 678d213..bcfa455 100644 --- a/src/PhoneDetector.php +++ b/src/PhoneDetector.php @@ -2,7 +2,7 @@ /** * @author Pierre-Henry Soria * @link https://pierrehenry.be - * @copyright (c) 2019, Pierre-Henry Soria. All Rights Reserved. + * @copyright (c) 2019-2022, Pierre-Henry Soria. All Rights Reserved. * @license MIT License */ @@ -40,6 +40,6 @@ private function testUserAgentWith(string $regex): bool private function getUserAgent(): string { - return (string)$_SERVER['HTTP_USER_AGENT']; + return $_SERVER['HTTP_USER_AGENT'] ?? ''; } }