diff --git a/bl-kernel/helpers/sanitize.class.php b/bl-kernel/helpers/sanitize.class.php index 72d0e813..8b57be83 100644 --- a/bl-kernel/helpers/sanitize.class.php +++ b/bl-kernel/helpers/sanitize.class.php @@ -33,8 +33,8 @@ class Sanitize { // Remove javascript from links public static function noJSLink($text) { - $text = trim($text); - while(strpos($text, 'javascript')===0){ + $text = preg_replace("/\s+/", "", $text); + while(strpos($text, 'javascript:')===0){ $text = preg_replace("/javascript\s*:\s*/", "", $text); } return $text;