X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=boot.php;h=7e76df87e36c0b2fed34f19e39ea5b31a257fdee;hb=b1999459afe1f955e7373f4b4894b44324b10e1e;hp=74609b89685801c52db655bf833e0d96b0a7f045;hpb=31ad26aae2856fdf7921c53abb8ae525792a05d4;p=friendica.git diff --git a/boot.php b/boot.php index 74609b8968..7e76df87e3 100644 --- a/boot.php +++ b/boot.php @@ -1041,20 +1041,28 @@ class App { /** * @brief Removes the baseurl from an url. This avoids some mixed content problems. * - * @param string $url + * @param string $orig_url * * @return string The cleaned url */ - function remove_baseurl($url){ + function remove_baseurl($orig_url){ // Is the function called statically? - if (!is_object($this)) - return(self::$a->remove_baseurl($url)); + if (!is_object($this)) { + return(self::$a->remove_baseurl($orig_url)); + } - $url = normalise_link($url); + // Remove the hostname from the url if it is an internal link + $nurl = normalise_link($orig_url); $base = normalise_link($this->get_baseurl()); - $url = str_replace($base."/", "", $url); - return $url; + $url = str_replace($base."/", "", $nurl); + + // if it is an external link return the orignal value + if ($url == normalise_link($orig_url)) { + return $orig_url; + } else { + return $url; + } } /** @@ -1377,7 +1385,7 @@ class App { function proc_run($args) { // Add the php path if it is a php call - if (count($args) && ($args[0] === 'php' OR is_int($args[0]))) { + if (count($args) && ($args[0] === 'php' OR !is_string($args[0]))) { // If the last worker fork was less than 10 seconds before then don't fork another one. // This should prevent the forking of masses of workers.