HTTPS support in validate_url()

Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
Roland Haeder 2016-05-01 14:58:41 +02:00
parent 738e22d3eb
commit f88345cbea
No known key found for this signature in database
GPG Key ID: B72F8185C6C7BD78

View File

@ -703,10 +703,12 @@ function validate_url(&$url) {
if(get_config('system','disable_url_validation')) if(get_config('system','disable_url_validation'))
return true; return true;
// no naked subdomains (allow localhost for tests) // no naked subdomains (allow localhost for tests)
if(strpos($url,'.') === false && strpos($url,'/localhost/') === false) if(strpos($url,'.') === false && strpos($url,'/localhost/') === false)
return false; return false;
if(substr($url,0,4) != 'http')
if(substr($url,0,4) != 'http' && substr($url,0,5) != 'https')
$url = 'http://' . $url; $url = 'http://' . $url;
$h = @parse_url($url); $h = @parse_url($url);