} // END - if
// Extract host name
- $host = str_replace('http://', '', $url);
+ $host = str_replace(array('http://', 'https://'), array('', ''), $url);
+
+ // Is there a slash at the end?
if (isInString('/', $host)) {
$host = substr($host, 0, strpos($host, '/'));
} // END - if
+ // Is there a double-dot in? (Means port number)
+ if (strpos($host, ':') !== FALSE) {
+ // Detected a double-dot
+ $hostArray = explode(':', $host);
+ $host = $hostArray[0];
+ } // END - if
+
// Generate relative URL
//* DEBUG: */ debugOutput('SCRIPT=' . $script);
if (substr(strtolower($script), 0, 7) == 'http://') {
}
} else {
// Write it with fopen
- $fp = fopen($FQFN, 'w')
- or reportBug(__FUNCTION__, __LINE__, 'Cannot write to file ' . basename($FQFN) . '!');
+ $fp = fopen($FQFN, 'w') or reportBug(__FUNCTION__, __LINE__, 'Cannot write to file ' . basename($FQFN) . '!');
// Aquire a lock?
if ($aquireLock === TRUE) {