From 92566e5c31e99da99a3e27b63d9d78bac4721405 Mon Sep 17 00:00:00 2001 From: Fil <fil@rezo.net> Date: Mon, 31 Jan 2005 13:46:17 +0000 Subject: [PATCH] bug <INCLURE> et acces aux variables globales (Pierre Andrews) --- inc-public-global.php3 | 21 ++++++++++----------- inc-public.php3 | 14 +++++++++++--- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/inc-public-global.php3 b/inc-public-global.php3 index 552b7a11e8..86a486c785 100644 --- a/inc-public-global.php3 +++ b/inc-public-global.php3 @@ -404,19 +404,18 @@ function inclure_balise_dynamique($r) { ($GLOBALS['spip_lang'] != lire_meta('langue_site'))) $contexte_inclus['lang'] = $GLOBALS['spip_lang']; - inclure_page_lang($fond, $delais, $contexte_inclus); - } -} -function inclure_page_lang($fond, $delais, $contexte_inclus) { - $page = inclure_page($fond, $delais, $contexte_inclus); - if ($page['process_ins'] == 'html') - echo $page['texte']; - else - eval('?' . '>' . $page['texte']); + // Appeler la page + $page = inclure_page($fond, $delais, $contexte_inclus); + if ($page['process_ins'] == 'html') + echo $page['texte']; + else + eval('?' . '>' . $page['texte']); + + if ($page['lang_select']) + lang_dselect(); - if ($page['lang_select']) - lang_dselect(); + } } diff --git a/inc-public.php3 b/inc-public.php3 index 99725bc550..f18d6b032f 100644 --- a/inc-public.php3 +++ b/inc-public.php3 @@ -3,9 +3,17 @@ // Distinguer une inclusion d'un appel initial -if (function_exists('inclure_page_lang')) - inclure_page_lang($fond, $delais, $contexte_inclus); -else { +if (defined("_INC_PUBLIC_GLOBAL")) { + $page = inclure_page($fond, $delais, $contexte_inclus); + if ($page['process_ins'] == 'html') + echo $page['texte']; + else + eval('?' . '>' . $page['texte']); + + if ($page['lang_select']) + lang_dselect(); + +} else { define ("_INC_PUBLIC", 1); include ("ecrire/inc_version.php3"); include_local('inc-public-global.php3'); -- GitLab