// Is this URL valid?
if (substr($script, 0, 7) == 'http://') {
// Use the hostname from script URL as new hostname
- $url = substr($script, 7);
- $extract = explode('/', $url);
+ $extract = explode('/', substr($script, 7));
$url = $extract[0];
- // Done extracting the URL :)
- } // END - if
+ } elseif (substr($script, 0, 8) == 'https://') {
+ // Use the hostname from script URL as new hostname
+ $extract = explode('/', substr($script, 8));
+ $url = $extract[0];
+ }
// Extract host name
$host = str_replace(array('http://', 'https://'), array('', ''), $url);