From 48a1a36222ddcf1cb637302bdd09e2bcf9b15844 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 28 Dec 2013 00:02:55 +0100 Subject: [PATCH] Correction bug base_url MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit À appliquer aussi à la 0.7-beta --- app/i18n/install.en.php | 2 +- app/i18n/install.fr.php | 4 ++-- lib/Minz/Request.php | 9 ++++++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/i18n/install.en.php b/app/i18n/install.en.php index 74245d63b..8df48989f 100644 --- a/app/i18n/install.en.php +++ b/app/i18n/install.en.php @@ -55,7 +55,7 @@ return array ( 'update_start' => 'Start update process', 'update_long' => 'This can take a long time, depending on the size of your database. You may have to wait for this page to time out (~5 minutes) and then refresh this page.', - 'installation_is_ok' => 'The installation process was successful.
The final step will now attempt to delete the ./public/install.php file and any database backup created during the update process.
You may choose to skip this step and delete ./public/install.php manually.', + 'installation_is_ok' => 'The installation process was successful.
The final step will now attempt to delete the ./p/i/install.php file and any database backup created during the update process.
You may choose to skip this step and delete ./p/i/install.php manually.', 'finish_installation' => 'Complete installation', 'install_not_deleted' => 'Something went wrong; you must delete the file %s manually.', ); diff --git a/app/i18n/install.fr.php b/app/i18n/install.fr.php index 9b7a9bdff..a1ae8fcb5 100644 --- a/app/i18n/install.fr.php +++ b/app/i18n/install.fr.php @@ -41,7 +41,7 @@ return array ( 'general_conf_is_ok' => 'La configuration générale a été enregistrée.', 'random_string' => 'Chaîne aléatoire', 'change_value' => 'Vous devriez changer cette valeur par n’importe quelle autre', - 'base_url' => 'Base de l’url', + 'base_url' => 'Base de l’URL', 'do_not_change_if_doubt' => 'Laissez tel quel dans le doute', 'bdd_conf_is_ok' => 'La configuration de la base de données a été enregistrée.', @@ -55,7 +55,7 @@ return array ( 'update_start' => 'Lancer la mise à jour', 'update_long' => 'Ce processus peut prendre longtemps, selon la taille de votre base de données. Vous aurez peut-être à attendre que cette page dépasse son temps maximum d’exécution (~5 minutes) puis à la recharger.', - 'installation_is_ok' => 'L’installation s’est bien passée.
La dernière étape va maintenant tenter de supprimer le fichier /public/install.php, ainsi que d’éventuelles copies de base de données créées durant le processus de mise à jour.
Vous pouvez choisir de sauter cette étape et de supprimer /public/install.php manuellement.', + 'installation_is_ok' => 'L’installation s’est bien passée.
La dernière étape va maintenant tenter de supprimer le fichier ./p/i/install.php, ainsi que d’éventuelles copies de base de données créées durant le processus de mise à jour.
Vous pouvez choisir de sauter cette étape et de supprimer ./p/i/install.php manuellement.', 'finish_installation' => 'Terminer l’installation', 'install_not_deleted' => 'Quelque chose s’est mal passé, vous devez supprimer le fichier %s à la main.', ); diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php index fb48bd7a2..d4e1355d7 100644 --- a/lib/Minz/Request.php +++ b/lib/Minz/Request.php @@ -96,7 +96,14 @@ class Minz_Request { * @return la base de l'url */ public static function getBaseUrl () { - return Minz_Configuration::baseUrl (); + $defaultBaseUrl = Minz_Configuration::baseUrl(); + if (!empty($defaultBaseUrl)) { + return $defaultBaseUrl; + } elseif (isset($_SERVER['REQUEST_URI'])) { + return dirname($_SERVER['REQUEST_URI']) . '/'; + } else { + return '/'; + } } /**