Improved handling of invalid links
This commit is contained in:
parent
029daef997
commit
5290f0cd51
1 changed files with 2 additions and 1 deletions
|
@ -569,6 +569,7 @@ class Network
|
||||||
*/
|
*/
|
||||||
public static function isValidHttpUrl(string $url)
|
public static function isValidHttpUrl(string $url)
|
||||||
{
|
{
|
||||||
return in_array(parse_url($url, PHP_URL_SCHEME), ['http', 'https']) && parse_url($url, PHP_URL_HOST);
|
$scheme = parse_url($url, PHP_URL_SCHEME);
|
||||||
|
return !empty($scheme) && in_array($scheme, ['http', 'https']) && parse_url($url, PHP_URL_HOST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue