From d04a068fb3682947c105b25f147e48cef6a897ea Mon Sep 17 00:00:00 2001
From: Fil <fil@rezo.net>
Date: Sat, 28 Jan 2006 21:10:13 +0000
Subject: [PATCH] =?UTF-8?q?honorer=20le=20$dossier=5Fsquelettes=20pr=C3=A9?=
 =?UTF-8?q?sent=20dans=20mes=5Ffonctions.php3=20(=C3=A7a=20devient=20horri?=
 =?UTF-8?q?ble=20=C3=A0=20maintenir)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ecrire/inc_utils.php | 6 +++---
 inc-calcul.php3      | 7 +++++--
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/ecrire/inc_utils.php b/ecrire/inc_utils.php
index f4525651d1..cb27fa47dd 100644
--- a/ecrire/inc_utils.php
+++ b/ecrire/inc_utils.php
@@ -577,11 +577,11 @@ function find_in_path ($filename, $path='AUTO', $sinon='') {
 			// Ajouter les repertoires des plugins
 			foreach ($GLOBALS['plugins'] as $plug)
 				$autopath = _DIR_PLUGINS.$plug.'/:'.$autopath;
-
-			if ($GLOBALS['dossier_squelettes'])
-				$autopath = $GLOBALS['dossier_squelettes'].'/:'.$autopath;
 		}
 		$path = $autopath;
+
+		if ($GLOBALS['dossier_squelettes'])
+			$path = $GLOBALS['dossier_squelettes'].'/:'.$path;
 	}
 #spip_log("path = $path");
 
diff --git a/inc-calcul.php3 b/inc-calcul.php3
index 3971c6a768..eab33923d8 100644
--- a/inc-calcul.php3
+++ b/inc-calcul.php3
@@ -30,8 +30,11 @@ include_ecrire("inc_distant");
 include_local("inc-calcul-outils");
 
 // NB: Ce fichier peut initialiser $dossier_squelettes (old-style)
-if ($f = find_in_path("mes_fonctions" . _EXTENSION_PHP))
-	include_local ($f);
+// donc il faut l'inclure "en globals"
+if ($f = find_in_path("mes_fonctions" . _EXTENSION_PHP)) {
+	global $dossier_squelettes;
+	include ($f);
+}
 
 charger_generer_url();
 
-- 
GitLab