Index: wheels/spip/echappe-js.php
===================================================================
--- wheels/spip/echappe-js.php (revision 111436)
+++ wheels/spip/echappe-js.php (working copy)
@@ -18,26 +18,14 @@
}
$texte = &$match[0];
- // on echappe les urls data: javascript: et tout ce qui ressemble
- if (strpos($texte, ":") !== false
- and preg_match(",(data|script)\s*:,iS", $texte)
+ if (
+ (strpos($texte, ":") !== false and preg_match(",(data|script)\s*:,iS", $texte) ) or
+ (stripos($texte, "on") !== false and preg_match(",\bon\w+\s*=,i", $texte) )
) {
- $texte = nl2br(htmlspecialchars($texte));
- } // on echappe si on a possiblement un attribut onxxx et que ca passe pas dans safehtml
- elseif (stripos($texte, "on") !== false
- and preg_match(",\bon\w+\s*=,i", $texte)
- ) {
if (!isset($safehtml)) {
$safehtml = charger_fonction('safehtml', 'inc', true);
}
- if (!$safehtml or strlen($safehtml($texte)) !== strlen($texte)) {
- $texte = nl2br(htmlspecialchars($texte));
- }
+ $texte = $safehtml($texte);
}
-
- if (strpos($texte, "<") === false) {
- $texte = "$texte
";
- }
-
return $texte;
}
Index: wheels/spip/echappe-js.yaml
===================================================================
--- wheels/spip/echappe-js.yaml (revision 111436)
+++ wheels/spip/echappe-js.yaml (working copy)
@@ -20,49 +20,8 @@
replace: "$0
"
-
- if_str: "