From ab8f54abb3f034abf84781d3f89b9eb5fbb28e54 Mon Sep 17 00:00:00 2001
From: Cerdic <cedric@yterium.com>
Date: Mon, 22 Jan 2007 19:01:48 +0000
Subject: [PATCH] "petits details du parseur xml sur les noms de tag : eviter
 de prendre les espaces finaux, en particulier sur les tags auto fermant (<tag
 />)"

---
 ecrire/inc/xml.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ecrire/inc/xml.php b/ecrire/inc/xml.php
index 2333b8b94c..45d71d09c9 100644
--- a/ecrire/inc/xml.php
+++ b/ecrire/inc/xml.php
@@ -54,12 +54,12 @@ function spip_xml_parse($texte, $strict=true, $clean=true){
 		if (strlen($before)>0)
 			return $texte; // before non vide, donc on est dans du texte
 	
-		$tag = $chars[1];
+		$tag = rtrim($chars[1]);
 		$closing_tag = explode(" ",trim($tag));$closing_tag=reset($closing_tag);
 		$txt = $chars[2];
 	
 		if(substr($tag,-1)=='/'){ // self closing tag
-			$tag = substr($tag,0,strlen($tag)-1);
+			$tag = rtrim(substr($tag,0,strlen($tag)-1));
 			$out[$tag][]="";
 		}
 		else{
@@ -114,7 +114,7 @@ function spip_xml_aplatit($arbre,$separateur = " "){
 						$tagf = $tagf[0];
 						$s.="<$tag>$f</$tagf>";
 					}
-					else $s.="<$tag/>";
+					else $s.="<$tag />";
 				}
 				else
 					$s.=spip_xml_aplatit($feuille);
-- 
GitLab