From 2f78f5d33d1b77d45721a409156b11bb3feb2631 Mon Sep 17 00:00:00 2001 From: Brent Roose Date: Fri, 4 May 2018 10:27:09 +0200 Subject: [PATCH] Add extra null check --- src/RobotsTxt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RobotsTxt.php b/src/RobotsTxt.php index efced7a..1292cc1 100644 --- a/src/RobotsTxt.php +++ b/src/RobotsTxt.php @@ -38,7 +38,7 @@ public static function create(string $source): self public function allows(string $url, ?string $userAgent = '*'): bool { - $path = parse_url($url, PHP_URL_PATH); + $path = parse_url($url, PHP_URL_PATH) ?? ''; $disallows = $this->disallowsPerUserAgent[$userAgent] ?? $this->disallowsPerUserAgent['*'] ?? [];