Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Commit 06ecbd2

Browse files
Merge pull request #9 from gerben86/master
Add try/catch around call to splitURL
2 parents 47a9513 + 471361e commit 06ecbd2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

libs/PHPCrawlerURLFilter.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,12 @@ public static function keepRedirectUrls(PHPCrawlerDocumentInfo $DocumentInfo, $d
136136
*/
137137
protected function urlMatchesRules(PHPCrawlerURLDescriptor $url): bool
138138
{
139-
// URL-parts of the URL to check against the filter-rules
140-
$url_parts = PHPCrawlerUtils::splitURL($url->url_rebuild);
139+
try{
140+
// URL-parts of the URL to check against the filter-rules
141+
$url_parts = PHPCrawlerUtils::splitURL($url->url_rebuild);
142+
} catch (Throwable $t) {
143+
return false;
144+
}
141145

142146
// Kick out all links that are NOT of protocol "http" or "https"
143147
if (( !isset($url_parts) || !isset($url_parts['protocol']))

0 commit comments

Comments
 (0)