Skip to content

Commit 4c4f430

Browse files
committed
remove url validation as it's not necessary
1 parent ece2da7 commit 4c4f430

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

src/FaviconExtractor.php

-20
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ public function __construct(FaviconFactoryInterface $faviconFactory, ProviderInt
2929

3030
public function fromUrl(string $url): FaviconExtractorInterface
3131
{
32-
if (!$this->isValidUrl($url)) {
33-
throw new InvalidUrlException();
34-
}
35-
3632
$this->url = $url;
3733

3834
return $this;
@@ -75,20 +71,4 @@ private function getTargetPath(string $path, string $filename): string
7571
{
7672
return $path.DIRECTORY_SEPARATOR.$filename.'.png';
7773
}
78-
79-
private function isValidUrl(string $url): bool
80-
{
81-
$pattern = '/^
82-
(http|https):\\/\\/
83-
(
84-
[a-z0-9]+([\\-\\.]{1}[a-z_0-9]+)*\\.[a-z]{2,5}
85-
|
86-
(([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])
87-
)
88-
(:[0-9]+)?
89-
(\\/.*)?
90-
$/ixu';
91-
92-
return preg_match($pattern, $url) > 0;
93-
}
9474
}

0 commit comments

Comments
 (0)