1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

Bugfix: internal link detection was failing. Also added support for [link=url rel=internal] for overriding default preference.

This commit is contained in:
CaMer0n
2007-11-13 07:38:55 +00:00
parent f2f48f657b
commit 851f8cc320
3 changed files with 26 additions and 13 deletions

View File

@@ -12,6 +12,7 @@ global $pref;
[link=external=http://mysite.com]My text[/link]
*/
$parm = trim($parm);
/* Fix for people using link=external= */
@@ -38,8 +39,14 @@ global $pref;
$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($extras == "external" || strpos($extras,"rel=external")!==FALSE)
{
$insert = "rel='external' ";
}
else
{
$insert = ($pref['links_new_window'] && strpos($link,"{e_")===FALSE && substr($link,0,1) != "#" && strpos($extras,"rel=internal")===FALSE) ? "rel='external' " : "";
}
if (strtolower(substr($link,0,11)) == 'javascript:') return '';
return "<a class='bbcode' href='".$tp -> toAttribute($link)."' ".$insert.">".$code_text."</a>";