2006-12-02 04:36:16 +00:00
|
|
|
global $pref;
|
|
|
|
|
|
|
|
$parm = trim($parm);
|
|
|
|
$external = ($pref['links_new_window'] || strpos($parm, 'external') === 0) ? " rel='external'" : "";
|
|
|
|
|
|
|
|
if ($parm && $parm != 'external' && strpos($parm, ' ') === FALSE)
|
|
|
|
{
|
|
|
|
$parm = preg_replace('#^external.#is', '', $parm);
|
2007-06-15 19:30:57 +00:00
|
|
|
if (strtolower(substr($parm,0,11)) == 'javascript:') return '';
|
2006-12-02 04:36:16 +00:00
|
|
|
return "<a href='".$tp -> toAttribute($parm)."'".$external.">".$code_text."</a>";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-08-08 19:40:29 +00:00
|
|
|
if (strtolower(substr($code_text,0,11)) == 'javascript:') return '';
|
2006-12-02 04:36:16 +00:00
|
|
|
return "<a href='".$tp -> toAttribute($code_text)."'".$external.">".$code_text."</a>";
|
|
|
|
}
|