]> git.mxchange.org Git - friendica.git/commitdiff
HTTPS support in validate_url()
authorRoland Haeder <roland@mxchange.org>
Sun, 1 May 2016 12:58:41 +0000 (14:58 +0200)
committerRoland Haeder <roland@mxchange.org>
Sun, 1 May 2016 12:58:41 +0000 (14:58 +0200)
Signed-off-by: Roland Haeder <roland@mxchange.org>
include/network.php

index a7f944d90ac480a4c702dd7dfdf5c5d8dd72c032..68dff08a5124104e8b7e51bbf66594f07e42fe82 100644 (file)
@@ -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);