Browse Source

HTTPS support in validate_url()

Signed-off-by: Roland Haeder <roland@mxchange.org>
pull/3010/head
Roland Haeder 4 years ago
parent
commit
f88345cbea
No known key found for this signature in database GPG Key ID: B72F8185C6C7BD78
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      include/network.php

+ 3
- 1
include/network.php View 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);


Loading…
Cancel
Save