X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=www%2Fecrire%2Fbalise%2Fformulaire_.php;fp=www%2Fecrire%2Fbalise%2Fformulaire_.php;h=511978a002030939f35e4145a11690ef27f43e39;hb=122c920eb07e3f665789f8734965b576e6c25515;hp=f57f94b036bc53b83f8c17397babae3a29ae9653;hpb=226942065cd4f604eb464addf45a065c9e5bc916;p=lhc%2Fweb%2Fwww.git diff --git a/www/ecrire/balise/formulaire_.php b/www/ecrire/balise/formulaire_.php index f57f94b0..511978a0 100644 --- a/www/ecrire/balise/formulaire_.php +++ b/www/ecrire/balise/formulaire_.php @@ -2,7 +2,7 @@ /***************************************************************************\ * SPIP, Systeme de publication pour l'internet * * * - * Copyright (c) 2001-2012 * + * Copyright (c) 2001-2014 * * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * * * * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * @@ -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 = spip_htmlspecialchars($texte,ENT_QUOTES); + } } return $texte; }