From f1c15128776aad3d68ce6f633b9e2c8d50c96ce3 Mon Sep 17 00:00:00 2001 From: "Committo,Ergo:sum" <esj@rezo.net> Date: Thu, 22 Dec 2005 23:36:00 +0000 Subject: [PATCH] fonctionnalisation des appels de scripts php (encore 69 avant l'autoroute) --- ecrire/inc_upgrade.php | 16 ++++++++-------- ecrire/inc_utils.php | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ecrire/inc_upgrade.php b/ecrire/inc_upgrade.php index 44b61cff39..e990b5adb8 100644 --- a/ecrire/inc_upgrade.php +++ b/ecrire/inc_upgrade.php @@ -28,14 +28,14 @@ function upgrade_dist() @copy(_FILE_CONNECT, _FILE_CONNECT_INS); install_debut_html(_T('titre_page_upgrade')); - echo "<p><b>",_T('texte_nouvelle_version_spip_1'),"</b><p> "; - echo _T('texte_nouvelle_version_spip_2'); - echo "<p><div align='right'>"; - echo '<form action="upgrade.php3">'; - echo "<input type='submit' value=\"", + echo "<p><b>",_T('texte_nouvelle_version_spip_1'),"</b><p> ", + _T('texte_nouvelle_version_spip_2'), + "<p><div align='right'>", + '<form action=', http_php_script("upgrade"), '>', + "<input type='submit' value=\"", _T('bouton_relancer_installation'), - "\" class='fondl'>"; - echo "</form>\n"; + "\" class='fondl'>", + "</form>\n"; install_fin_html(); exit; } @@ -110,7 +110,7 @@ function demande_maj_version() function info_install() { // Soit on est dans ecrire/ et on envoie sur l'installation - if (@file_exists("inc_version.php3")) { + if (@file_exists("inc_version" . _EXTENSION_PHP)) { header("Location: " . 'install' . _EXTENSION_PHP); exit; } diff --git a/ecrire/inc_utils.php b/ecrire/inc_utils.php index 38d9962e56..fd6c718753 100644 --- a/ecrire/inc_utils.php +++ b/ecrire/inc_utils.php @@ -19,12 +19,12 @@ if (!defined("_ECRIRE_INC_VERSION")) return; $included_files = array(); function include_local($file, $silence=false) { - $nom = preg_replace("/\.php3?$/",'', $file); + $nom = preg_replace("/\.php[3]?$/",'', $file); # spip_log("$nom $file"); if (@$GLOBALS['included_files'][$nom]++) return; if (is_readable($f = $nom . '.php')) include($f); - else if (is_readable($f = $nom . '.php3')) + else if (is_readable($f = $nom . _EXTENSION_PHP)) include($f); else if (!$silence) spip_log($file . " illisible"); } @@ -41,7 +41,7 @@ function include_ecrire($file) { function include_fonction($nom) { # Hack pour etre compatible avec les mes_options qui appellent cette fonction define_once('_DIR_INCLUDE', _DIR_RESTREINT); - $nom = preg_replace("/\.php3?$/",'', basename($nom)); + $nom = preg_replace("/\.php[3]?$/",'', basename($nom)); $inc = ('inc_' . $nom); # spip_log("if $inc"); $f = find_in_path($inc . '.php'); @@ -52,8 +52,8 @@ function include_fonction($nom) { if (is_readable($f)) { if (!$GLOBALS['included_files'][$inc]++) include($f); } else { - // provisoire avant renommage php/php3 - $f = _DIR_INCLUDE . ('inc_' . $nom . '.php3'); + // provisoire avant renommage + $f = _DIR_INCLUDE . ('inc_' . $nom . _EXTENSION_PHP); if (is_readable($f)) { if (!$GLOBALS['included_files'][$inc]++) include($f); } else $inc = ""; @@ -428,7 +428,7 @@ function spip_touch($fichier, $duree=0, $touch=true) { // // cron() : execution des taches de fond -// quand il est appele par spip_background.php3, il est gourmand ; +// quand il est appele par spip_background, il est gourmand ; // quand il est appele par inc-public il n'est pas gourmand // function cron($gourmand = false) { -- GitLab