X-Git-Url: http://git.heureux-cyclage.org/?p=ptitvelo%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Fbalise%2Fformulaire_.php;h=f552351a75d46a197b92cdf72e37c4a3206a459f;hp=f57f94b036bc53b83f8c17397babae3a29ae9653;hb=dae7b78d26d32fb23e8c524f795bbaf40e685c6a;hpb=33b1462fcc1e5fa853f6ca84daa7cff72cdbe706 diff --git a/www/ecrire/balise/formulaire_.php b/www/ecrire/balise/formulaire_.php index f57f94b..f552351 100644 --- a/www/ecrire/balise/formulaire_.php +++ b/www/ecrire/balise/formulaire_.php @@ -17,6 +17,7 @@ if (!defined('_ECRIRE_INC_VERSION')) return; include_spip('inc/filtres'); +include_spip('inc/texte'); /** * Protéger les saisies d'un champ de formulaire @@ -37,7 +38,12 @@ function protege_champ($texte){ // ne pas corrompre une valeur serialize if ((preg_match(",^[abis]:\d+[:;],", $texte) AND unserialize($texte)!=false) OR is_null($texte)) return $texte; - $texte = entites_html($texte); + if (is_string($texte) + AND $texte + AND strpbrk($texte, "&\"'<>")!==false + ) { + $texte = htmlspecialchars(echappe_retour(echappe_html($texte,'',true),'','proteger_amp'),ENT_QUOTES); + } } return $texte; }