
4 changed files with 8 additions and 8 deletions
@ -1,13 +1,13 @@
|
||||
<?php |
||||
|
||||
|
||||
|
||||
function inc_echapper_html_suspect_dist($texte, $strict=true) { |
||||
if (!$texte |
||||
or strpos($texte, '<') === false or strpos($texte, '=') === false) { |
||||
return $texte; |
||||
} |
||||
if (preg_match("@^</?[a-z]{1,5}(\s+class\s*=\s*['\"][a-z _\s-]+['\"])?\s?/?>$@iS", $texte)) return $texte; |
||||
if ( preg_match("@^(</?(?!script)[a-z]+(\s+class\s*=\s*['\"][a-z _\s-]+['\"])?\s?/?>[\w\s]*)+$@iS", $texte) ){ |
||||
return $texte; // input non filtré, $texte doit être safe ! |
||||
} |
||||
$texte = safehtml($texte); |
||||
return $texte; |
||||
} |
||||
|
Loading…
Reference in new issue