Invalid URL would cause error.

This commit is contained in:
Parziphal 2014-01-27 10:20:19 -05:00
parent 98d44e06c8
commit e1baa567d1
1 changed files with 1 additions and 2 deletions

View File

@ -28,9 +28,8 @@ abstract class Danbooru
$file = '';
$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');
# check if the request uri is not percent-encoded