From: Roland Haeder Date: Sun, 1 May 2016 12:58:41 +0000 (+0200) Subject: HTTPS support in validate_url() X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f88345cbea4bc40c8391f27a75f4b3fe5a3bbde4;p=friendica.git HTTPS support in validate_url() Signed-off-by: Roland Haeder --- diff --git a/include/network.php b/include/network.php index a7f944d90a..68dff08a51 100644 --- a/include/network.php +++ b/include/network.php @@ -703,10 +703,12 @@ function validate_url(&$url) { if(get_config('system','disable_url_validation')) return true; + // no naked subdomains (allow localhost for tests) if(strpos($url,'.') === false && strpos($url,'/localhost/') === false) return false; - if(substr($url,0,4) != 'http') + + if(substr($url,0,4) != 'http' && substr($url,0,5) != 'https') $url = 'http://' . $url; $h = @parse_url($url);