Invalid URL would cause error.
This commit is contained in:
parent
98d44e06c8
commit
e1baa567d1
@ -28,9 +28,8 @@ abstract class Danbooru
|
|||||||
$file = '';
|
$file = '';
|
||||||
|
|
||||||
$url = parse_url($source);
|
$url = parse_url($source);
|
||||||
// $url['host'] = url.normalized_host
|
|
||||||
|
|
||||||
if ($url['scheme'] != 'http' && $url['scheme'] != 'https')
|
if (empty($url['scheme']) || $url['scheme'] != 'http' && $url['scheme'] != 'https')
|
||||||
throw new Danbooru\Exception\RuntimeException('SocketError: URL must be HTTP or HTTPS');
|
throw new Danbooru\Exception\RuntimeException('SocketError: URL must be HTTP or HTTPS');
|
||||||
|
|
||||||
# check if the request uri is not percent-encoded
|
# check if the request uri is not percent-encoded
|
||||||
|
Reference in New Issue
Block a user