From 59a315d9400145155c07d1dfda29ca103417aa7b Mon Sep 17 00:00:00 2001
From: Cerdic <cedric@yterium.com>
Date: Mon, 13 Aug 2007 22:20:08 +0000
Subject: [PATCH] ameliorer attribut_html pour filtrer correctement les <p>
 (#761)

---
 ecrire/inc/filtres.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ecrire/inc/filtres.php b/ecrire/inc/filtres.php
index 6334242d58..9b6b188709 100644
--- a/ecrire/inc/filtres.php
+++ b/ecrire/inc/filtres.php
@@ -506,7 +506,7 @@ function taille_en_octets ($taille) {
 // Rend une chaine utilisable sans dommage comme attribut HTML
 // http://doc.spip.org/@attribut_html
 function attribut_html($texte) {
-	$texte = texte_backend(supprimer_tags($texte));
+	$texte = texte_backend(preg_replace(array(",\n,",",\s(?=\s),ms"),array(" ",""),textebrut($texte)));
 	$texte = str_replace(array("'",'"'),array('&#39;', '&#34;'), $texte);
 	
 	return preg_replace(array("/&(amp;|#38;)/","/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/"),array("&","&#38;") , $texte);
-- 
GitLab