From 15206d9d782f2afe3265129d1d3be51245ce54a5 Mon Sep 17 00:00:00 2001 From: zone Date: Fri, 25 May 2001 02:39:54 +0000 Subject: [PATCH] Added html_link_email and fixed html_link for absolute URLs --- filemanager/inc/html.inc.php | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/filemanager/inc/html.inc.php b/filemanager/inc/html.inc.php index f5c65aaa46..a384f12d9a 100755 --- a/filemanager/inc/html.inc.php +++ b/filemanager/inc/html.inc.php @@ -275,11 +275,17 @@ function html_link ($href = NULL, $text = NULL, $return = 0, $encode = 1) ### $href = preg_replace ("/%2F/", "/", $href); $text = trim ($text); -/* - $rstring = "$text"; -*/ - $href = $sep . $href; - $address = $phpgw->link ($href); + + /* Auto-detect and don't disturb absolute links */ + if (!preg_match ("|^http(.{0,1})://|", $href)) + { + $href = $sep . $href; + $address = $phpgw->link ($href); + } + else + { + $address = $href; + } $rstring = "$text"; return (eor ($rstring, $return)); } @@ -313,6 +319,15 @@ function html_table_begin ($width = NULL, $border = NULL, $cellspacing = NULL, $ return (eor ($rstring, $return)); } +function html_link_email ($address = NULL, $text = NULL, $return = 0, $encode = 1) +{ + if ($encode) + $href = string_encode ($href, 1); + + $rstring = "$text"; + return (eor ($rstring, $return)); +} + function html_table_end ($return = 0) { $rstring = "";