Skip to content

Commit 2c2bbb8

Browse files
committed
throw an exception if the url is not valid
1 parent fd72dca commit 2c2bbb8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Url.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,8 @@ protected function buildUrl()
436436
*/
437437
protected function parseUrl($url)
438438
{
439-
if (strpos($url, '//') === 0) {
440-
$url = "http:$url";
439+
if (!filter_var($url, FILTER_VALIDATE_URL)) {
440+
throw new Exceptions\InvalidUrlException("The url '{$url}' is not valid");
441441
}
442442

443443
$this->info = parse_url($url);

0 commit comments

Comments
 (0)