make make_http not break with '' as an argument

This commit is contained in:
Shish 2010-01-18 08:29:35 +00:00
parent a1589ee722
commit ccaeca19eb

View File

@ -196,7 +196,7 @@ function make_link($page=null, $query=null) {
*/
function make_http($link) {
if(strpos($link, "ttp://") > 0) return $link;
if($link[0] != '/') $link = get_base_href().'/'.$link;
if(strlen($link) > 0 && $link[0] != '/') $link = get_base_href().'/'.$link;
$link = "http://".$_SERVER["HTTP_HOST"].$link;
$link = str_replace("/./", "/", $link);
return $link;