{
global $have_ent;
- print("<a href=\"");
- if (ereg("^[a-z]+://",$url) && !$have_ent)
- $url="redirect.php?location=".urlencode($url);
- print(htmlspecialchars($url)."\">$contents</a>");
+ $r="<a href=\"";
+ $urlent=htmlspecialchars($url);
+ if ($url==$urlent)
+ $r.=$url;
+ else if (!ereg("^[a-z]+://",$url)) // $url is our resource
+ $r.=$urlent;
+ else if (isset($have_ent) && !$have_ent) // non-ent client
+ $r.=$url;
+ else if ($have_ent) // ent client
+ $r.=$urlent;
+ else // unknown client, htmlspecialchars() should not be needed here
+ $r.=htmlspecialchars("redirect.php?location=".urlencode($url));
+ $r.="\">$contents</a>";
+ return($r);
}
function footer($delimit=true)