Skip to content

Commit

Permalink
Add extra null check
Browse files Browse the repository at this point in the history
  • Loading branch information
brendt committed May 4, 2018
1 parent 092670e commit 2f78f5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/RobotsTxt.php
Expand Up @@ -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['*'] ?? [];

Expand Down

0 comments on commit 2f78f5d

Please sign in to comment.