mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 12:48:26 +02:00
Bugtracker #4141 - missing link - thanks marj
This commit is contained in:
@@ -1,27 +1,45 @@
|
|||||||
global $pref;
|
global $pref;
|
||||||
|
|
||||||
$parm = trim($parm);
|
/*
|
||||||
$external = (($pref['links_new_window'] || strpos($parm, 'external') === 0) && substr($parm,0,1) != "#") ? " rel='external'" : "";
|
[link=$parm $extras]$code_text[/link]
|
||||||
|
Correct Usage:
|
||||||
|
[link=http://mysite.com external]My text[/link]
|
||||||
|
[link=http://mysite.com rel=external]My text[/link]
|
||||||
|
[link=external]http://mysite.com[/link]
|
||||||
|
[link]http://mysite.com[/link]
|
||||||
|
[link=mailto:myemail@email.com]My name[/link]
|
||||||
|
Historic usage:
|
||||||
|
[link=external=http://mysite.com]My text[/link]
|
||||||
|
*/
|
||||||
|
|
||||||
if(strpos($parm,"{e_")!==FALSE){
|
$parm = trim($parm);
|
||||||
$external = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(substr($parm,0,6) == "mailto")
|
/* Fix for people using link=external= */
|
||||||
{
|
if(strpos($parm,"external=") !== FALSE)
|
||||||
|
{
|
||||||
|
list($extras,$parm) = explode("=",$parm);
|
||||||
|
$parm = $parm." ".$extras;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(substr($parm,0,6) == "mailto")
|
||||||
|
{
|
||||||
list($pre,$email) = explode(":",$parm);
|
list($pre,$email) = explode(":",$parm);
|
||||||
list($p1,$p2) = explode("@",$email);
|
list($p1,$p2) = explode("@",$email);
|
||||||
return "<a class='bbcode' rel='external' href='javascript:window.location=\"mai\"+\"lto:\"+\"$p1\"+\"@\"+\"$p2\";self.close();' onmouseover='window.status=\"mai\"+\"lto:\"+\"$p1\"+\"@\"+\"$p2\"; return true;' onmouseout='window.status=\"\";return true;'>".$code_text."</a>";
|
return "<a class='bbcode' rel='external' href='javascript:window.location=\"mai\"+\"lto:\"+\"$p1\"+\"@\"+\"$p2\";self.close();' onmouseover='window.status=\"mai\"+\"lto:\"+\"$p1\"+\"@\"+\"$p2\"; return true;' onmouseout='window.status=\"\";return true;'>".$code_text."</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list($link,$extras) = explode(" ",$parm);
|
||||||
|
|
||||||
|
if(!$parm) $link = $code_text;
|
||||||
|
|
||||||
|
if($link == "external" && $extras == "")
|
||||||
|
{
|
||||||
|
$link = $code_text;
|
||||||
|
$extras = "rel=external";
|
||||||
|
}
|
||||||
|
|
||||||
|
$insert = (($pref['links_new_window'] || $extras == "external" || strpos($extras,"rel=external")!==FALSE) && strpos($link,"{e_")===FALSE && substr($link,0,1) != "#") ? "rel='external' " : "";
|
||||||
|
|
||||||
|
if (strtolower(substr($link,0,11)) == 'javascript:') return '';
|
||||||
|
return "<a class='bbcode' href='".$tp -> toAttribute($link)."' ".$insert.">".$code_text."</a>";
|
||||||
|
|
||||||
if ($parm && $parm != 'external' && strpos($parm, ' ') === FALSE)
|
|
||||||
{
|
|
||||||
$parm = preg_replace('#^external.#is', '', $parm);
|
|
||||||
if (strtolower(substr($parm,0,11)) == 'javascript:') return '';
|
|
||||||
return "<a class='bbcode' href='".$tp -> toAttribute($parm)."'".$external.">".$code_text."</a>";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (strtolower(substr($code_text,0,11)) == 'javascript:') return '';
|
|
||||||
return "<a class='bbcode' href='".$tp -> toAttribute($code_text)."'".$external.">".$code_text."</a>";
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user