From faaebf7b386511fe6f40826582edc3fe0db4565a Mon Sep 17 00:00:00 2001
From: Cerdic <cedric@yterium.com>
Date: Wed, 24 Jan 2007 11:45:51 +0000
Subject: [PATCH] manger les espaces autour du doctype avant de passer dans sax
 (pour php4)

---
 ecrire/inc/sax.php        | 2 +-
 ecrire/xml/interfaces.php | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ecrire/inc/sax.php b/ecrire/inc/sax.php
index c8da196701..93c5e22727 100644
--- a/ecrire/inc/sax.php
+++ b/ecrire/inc/sax.php
@@ -200,7 +200,7 @@ function inc_sax_dist($page, $apply=false)
 
 	xml_parser_free($xml_parser);
 
-	if ($res[0] == '<') return $doctype ."\n". $res;
+	if ($res[0] == '<') return trim($doctype). "\n" . $res;
 
 	$GLOBALS['xhtml_error'] = $res;
 
diff --git a/ecrire/xml/interfaces.php b/ecrire/xml/interfaces.php
index c8ac1bd0b8..a7b4443d77 100644
--- a/ecrire/xml/interfaces.php
+++ b/ecrire/xml/interfaces.php
@@ -15,7 +15,7 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
 include_spip('inc/sax');
 
 define('_REGEXP_DOCTYPE',
-	'/^\s*(<[?][^>]*>\s*)?<!DOCTYPE\s+(\w+)\s+(\w+)\s*([^>]*)>/');
+	'/^\s*(<[?][^>]*>\s*)?<!DOCTYPE\s+(\w+)\s+(\w+)\s*([^>]*)>\s*/');
 
 define('_SUB_REGEXP_SYMBOL', '[A-Za-z_][\w_:.-]*');
 
-- 
GitLab