From 648f9815d03f78d36c3e1825fa11c6ab53ff2439 Mon Sep 17 00:00:00 2001
From: Fil <fil@rezo.net>
Date: Mon, 16 Aug 2004 20:26:25 +0000
Subject: [PATCH] =?UTF-8?q?=C3=A9valuer=20les=20<INCLURE>=20en=20mode=20gl?=
 =?UTF-8?q?obal=20(spip-contrib)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 inc-public-global.php3 |  9 ++++-----
 inc-public.php3        | 15 +++++++++------
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/inc-public-global.php3 b/inc-public-global.php3
index 0e5243a30f..6d8887b4eb 100644
--- a/inc-public-global.php3
+++ b/inc-public-global.php3
@@ -172,7 +172,7 @@ function inclure_page($fond, $delais_inclus, $contexte_inclus, $cache_incluant='
 	|| ($GLOBALS['spip_lang'] != ($lang = lire_meta('langue_site')))) {
 		include_ecrire('inc_lang.php3');
 		lang_select($lang);
-		$lang_select = true; // pour lang_dselect ci-dessous
+		$lang_select = true; // pour lang_dselect en sortie
 	}
 
 	// @header ne marchera qu'en output_buffering
@@ -186,11 +186,10 @@ function inclure_page($fond, $delais_inclus, $contexte_inclus, $cache_incluant='
 	$page = obtenir_page ($contexte_inclus, $chemin_cache, $delais,
 	$use_cache, $fond, true);
 
-	// Et enfin le contenu...
-	eval('?' . '>' . $page['texte']);
+	$page['lang_select'] = $lang_select;
 
-	if ($lang_select)
-		lang_dselect();
+	// Retourner le contenu...
+	return $page;
 
 }
 
diff --git a/inc-public.php3 b/inc-public.php3
index 62aed1b04b..f48c1df26f 100644
--- a/inc-public.php3
+++ b/inc-public.php3
@@ -4,13 +4,16 @@
 if (defined("_INC_PUBLIC")) {
 	$page = inclure_page($fond, $delais, $contexte_inclus, $fichier_inclus);
 
-	/* if ($page['process_ins']) {
-		eval('?' . '>' .  $page['texte']); 
-	} else { 
-		echo $page['texte']; 
-	} */
+	if ($GLOBALS['afficher_page'] == 'oui'
+	AND $GLOBALS['auteur_session']['statut'] == '0minirezo') {
+		@header('Content-Type: text/plain; charset='.lire_meta('charset'));
+		echo $page['texte'];
+	} else {
+		eval('?' . '>' . $page['texte']);
+	}
 
-	eval('?' . '>' .  $page['texte']); 
+	if ($page['lang_select'])
+		lang_dselect();
 }
 
 // Premier appel inc-public
-- 
GitLab