X-Git-Url: http://git.cyclocoop.org/?p=ptitvelo%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Fbalise%2Fformulaire_.php;h=631b865674b14f238cf15e5f52d5ae181b829406;hp=f57f94b036bc53b83f8c17397babae3a29ae9653;hb=e847eea4a82a7396dd0abf860f9b30d654f38629;hpb=52cf8ed924d5dcd0c28dde4b6c3196be6ec2d4f7 diff --git a/www/ecrire/balise/formulaire_.php b/www/ecrire/balise/formulaire_.php index f57f94b..631b865 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,14 @@ 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); + } + elseif(is_bool($texte)) + $texte = ($texte?'1':''); } return $texte; }