From f88345cbea4bc40c8391f27a75f4b3fe5a3bbde4 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sun, 1 May 2016 14:58:41 +0200 Subject: [PATCH] HTTPS support in validate_url() Signed-off-by: Roland Haeder --- include/network.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);