From 669b2b5cd71627d76a9c7d07b67c675aaa9e7eb4 Mon Sep 17 00:00:00 2001 From: "Committo,Ergo:sum" <esj@rezo.net> Date: Mon, 27 Feb 2006 22:05:54 +0000 Subject: [PATCH] =?UTF-8?q?conserver=20l'ordre=20des=20surcharges=20adopt?= =?UTF-8?q?=C3=A9=20jusqu'=C3=A0=20pr=C3=A9sent,=20en=20attendant=20d'y=20?= =?UTF-8?q?voir=20plus=20clair?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecrire/inc_utils.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ecrire/inc_utils.php b/ecrire/inc_utils.php index 29bf125c51..b242f7c99b 100644 --- a/ecrire/inc_utils.php +++ b/ecrire/inc_utils.php @@ -70,8 +70,8 @@ function include_fonction($nom, $dossier='exec') { redirige_par_entete('./'); // Si la fonction existe deja (definie par mes_options, par exemple) - if (function_exists($f = $dossier.'_'.$nom)) -# OR function_exists($f = $dossier.'_'.$nom.'_dist')) + if (function_exists($f = $dossier.'_'.$nom) + OR function_exists($f = $dossier.'_'.$nom.'_dist')) return $f; // Sinon charger le fichier de declaration @@ -93,8 +93,7 @@ function include_fonction($nom, $dossier='exec') { } // -// une fonction destinee a remplacer include_ecrire, surchargeable -// par $surcharge['inc_truc'] = '/chemin/vers/truc.php' +// une fonction destinee a remplacer include_ecrire, pour les surcharges // function include_spip($f, $include = true) { // deja charge (nom) ? @@ -105,13 +104,12 @@ function include_spip($f, $include = true) { define('_DIR_INCLUDE', _DIR_RESTREINT); // une surcharge existe ? - if (!$s = $GLOBALS['surcharge'][$f] + if (!$s = find_in_path($f . '.php') + AND !$s = find_in_path($f . '.php3') // sinon, le fichier existe dans le repertoire ecrire ? AND !is_readable($s = _DIR_INCLUDE . $f . '.php') AND !is_readable($s = _DIR_INCLUDE . $f . '.php3') - // sinon, chercher dans le chemin - AND !$s = find_in_path($f . '.php') - AND !$s = find_in_path($f . '.php3')) +) return $GLOBALS['included_files'][$f] = false; // deja charge (chemin complet) ? -- GitLab