Skip to content

Commit 0641d4a

Browse files
committed
allow only http/https url schemes
1 parent ee93698 commit 0641d4a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Http/Url.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,10 @@ function ($matches) {
654654
throw new \InvalidArgumentException('Malformed URL: ' . $url);
655655
}
656656

657+
if (empty($parts['scheme']) || !in_array($parts['scheme'], ['http', 'https'])) {
658+
throw new \InvalidArgumentException(sprintf('Invalid URL scheme: "%s"', $parts['scheme']));
659+
}
660+
657661
foreach ($parts as $name => $value) {
658662
$parts[$name] = urldecode($value);
659663
}

0 commit comments

Comments
 (0)