From c293905157a052167a213791f037060fcb4fe6c4 Mon Sep 17 00:00:00 2001
From: Fil <fil@rezo.net>
Date: Mon, 20 Feb 2006 09:51:31 +0000
Subject: [PATCH] et un fichier qui se laisse appeler...

---
 .gitattributes  |  1 +
 ecrire/page.php | 30 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100644 ecrire/page.php

diff --git a/.gitattributes b/.gitattributes
index b7d206f429..4a60cd55ba 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -358,6 +358,7 @@ ecrire/lang/public_ru.php3 -text
 ecrire/lang/spip_br.php3 -text
 ecrire/lang/spip_cs.php3 -text
 ecrire/lang/spip_ru.php3 -text
+ecrire/page.php -text
 ecrire/polices/dustismo-license.txt -text svneol=unset#application/octet-stream
 ecrire/polices/dustismo.ttf -text
 ecrire/polices/dustismo_bold.ttf -text
diff --git a/ecrire/page.php b/ecrire/page.php
new file mode 100644
index 0000000000..5fbedf939f
--- /dev/null
+++ b/ecrire/page.php
@@ -0,0 +1,30 @@
+<?php
+
+// Appel spip
+if (!function_exists('find_in_path')) {
+	if (@file_exists('ecrire/inc_version.php')) {
+		include 'ecrire/inc_version.php';
+	} else exit;
+}
+
+// Reglage du $fond
+if (isset($contexte_inclus['fond']))
+	$fond = $contexte_inclus['fond'];
+else if (isset($_GET['page']))
+	$fond = $_GET['page'];
+else
+	$fond = 'sommaire';
+
+// Securite 
+if (strstr($fond, '/'))
+	die (_L("Faut pas se gener"));
+
+if (!find_in_path($fond.'.html')) {
+	spip_log("page: find_in_path ne trouve pas le squelette $fond");
+	echo _T('info_erreur_squelette2',
+		array('fichier' => htmlspecialchars($fond)));
+	$fond = '404';
+}
+include (_DIR_INCLUDE . 'public.php');
+
+?>
-- 
GitLab