Avoid DOS in noJSLink
This commit is contained in:
parent
e2226c01e7
commit
9965ea7296
1 changed files with 2 additions and 2 deletions
|
@ -33,8 +33,8 @@ class Sanitize {
|
||||||
// Remove javascript from links
|
// Remove javascript from links
|
||||||
public static function noJSLink($text)
|
public static function noJSLink($text)
|
||||||
{
|
{
|
||||||
$text = trim($text);
|
$text = preg_replace("/\s+/", "", $text);
|
||||||
while(strpos($text, 'javascript')===0){
|
while(strpos($text, 'javascript:')===0){
|
||||||
$text = preg_replace("/javascript\s*:\s*/", "", $text);
|
$text = preg_replace("/javascript\s*:\s*/", "", $text);
|
||||||
}
|
}
|
||||||
return $text;
|
return $text;
|
||||||
|
|
Loading…
Add table
Reference in a new issue