1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-28 18:30:53 +02:00

Do a bit of filtering on URLs

This commit is contained in:
e107steved
2007-06-15 19:30:57 +00:00
parent 4dbb2522ea
commit 7005fbdd00
2 changed files with 4 additions and 1 deletions

View File

@@ -17,10 +17,11 @@ if(substr($parm,0,6) == "mailto")
if ($parm && $parm != 'external' && strpos($parm, ' ') === FALSE) if ($parm && $parm != 'external' && strpos($parm, ' ') === FALSE)
{ {
$parm = preg_replace('#^external.#is', '', $parm); $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>"; return "<a class='bbcode' href='".$tp -> toAttribute($parm)."'".$external.">".$code_text."</a>";
} }
else else
{ {
if (strtolower(substr($parm,0,11)) == 'javascript:') return '';
return "<a class='bbcode' href='".$tp -> toAttribute($code_text)."'".$external.">".$code_text."</a>"; return "<a class='bbcode' href='".$tp -> toAttribute($code_text)."'".$external.">".$code_text."</a>";
} }

View File

@@ -6,9 +6,11 @@ $external = ($pref['links_new_window'] || strpos($parm, 'external') === 0) ? " r
if ($parm && $parm != 'external' && strpos($parm, ' ') === FALSE) if ($parm && $parm != 'external' && strpos($parm, ' ') === FALSE)
{ {
$parm = preg_replace('#^external.#is', '', $parm); $parm = preg_replace('#^external.#is', '', $parm);
if (strtolower(substr($parm,0,11)) == 'javascript:') return '';
return "<a href='".$tp -> toAttribute($parm)."'".$external.">".$code_text."</a>"; return "<a href='".$tp -> toAttribute($parm)."'".$external.">".$code_text."</a>";
} }
else else
{ {
if (strtolower(substr($parm,0,11)) == 'javascript:') return '';
return "<a href='".$tp -> toAttribute($code_text)."'".$external.">".$code_text."</a>"; return "<a href='".$tp -> toAttribute($code_text)."'".$external.">".$code_text."</a>";
} }