From 77df38741f0838ea0f7d0eb22bf7cb0451faf0e2 Mon Sep 17 00:00:00 2001
From: "Committo,Ergo:sum" <esj@rezo.net>
Date: Sun, 30 Jan 2005 08:42:38 +0000
Subject: [PATCH] =?UTF-8?q?envoyer=20le=20status=20http=20plutot=20qu'un?=
 =?UTF-8?q?=20bool=C3=A9en?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 inc-public-global.php3 | 6 +++---
 inc-public.php3        | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/inc-public-global.php3 b/inc-public-global.php3
index 7821926ba9..23b7b4c6d2 100644
--- a/inc-public-global.php3
+++ b/inc-public-global.php3
@@ -64,14 +64,14 @@ function calcule_header_et_page($fond, $delais) {
 		include_local(find_in_path('inc-formulaire_admin.php3'));
 
 	$tableau_des_erreurs = array();
-	$header404 = false;
+	$http_status = 200;
 	$page = afficher_page_globale ($fond, $delais, $use_cache);
 
 	if (!$flag_preserver) {
 
 		// si la page est vide, envoi d'un 404
 		if (preg_match('/^[[:space:]]*$/', $page['texte'])) {
-			$header404 = true;
+			$http_status = 404;
 			header("HTTP/1.0 404");
 			header("Content-Type: text/html; charset=".lire_meta('charset'));
 		}
@@ -137,7 +137,7 @@ function calcule_header_et_page($fond, $delais) {
 		$page = surligner_mots($page, $var_recherche);
 	}
 
-	return array($header404, $page);
+	return array($http_status, $page);
 	}
 
 //
diff --git a/inc-public.php3 b/inc-public.php3
index b9ac3c80b0..89a780ff83 100644
--- a/inc-public.php3
+++ b/inc-public.php3
@@ -9,12 +9,12 @@ else {
 	include ("ecrire/inc_version.php3");
 	include_local('inc-public-global.php3');
 
-	list($header404, $page) = calcule_header_et_page($fond, $delai);
+	list($http_status, $page) = calcule_header_et_page($fond, $delai);
 
 	// Si le 404 a ete renvoye (page vide), donner un message approprie
 	// Page n'est plus necessairement vide a cause des boutons admin
 
-	if ($header404) {
+	if ($http_status == 404) {
 		$qcq = _T('public:aucun_' . $fond);
 		if (!$qcq) $qcq = _T('public:aucune_' . $fond);
 		if (!$qcq) $qcq = _T('public:texte_vide');
-- 
GitLab