X-Git-Url: http://git.cyclocoop.org/?p=lhc%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Fbalise%2Fformulaire_.php;fp=www%2Fecrire%2Fbalise%2Fformulaire_.php;h=f552351a75d46a197b92cdf72e37c4a3206a459f;hp=f57f94b036bc53b83f8c17397babae3a29ae9653;hb=f08ec3a19775a7a173534b2d5cb7e9920b6253a6;hpb=58a2baa86ad2e12b4ff338d137f826a0a10ccbd7 diff --git a/www/ecrire/balise/formulaire_.php b/www/ecrire/balise/formulaire_.php index f57f94b0..f552351a 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; }