From c22761b60ab61bb47f5648725854b2d8e2f80fb6 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Thu, 5 Sep 2013 09:00:46 +0200 Subject: [PATCH] fix issue if base_url does not exists --- core/lib/Thelia/Tools/URL.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/lib/Thelia/Tools/URL.php b/core/lib/Thelia/Tools/URL.php index 84d35b457..f234f9086 100755 --- a/core/lib/Thelia/Tools/URL.php +++ b/core/lib/Thelia/Tools/URL.php @@ -79,7 +79,8 @@ class URL */ public function getBaseUrl() { - $lang = $this->container->get('request')->getSession()->getLang(); + $request = $this->container->get('request'); + $lang = $request->getSession()->getLang(); // Check if we have a specific URL for each lang. $one_domain_foreach_lang = ConfigQuery::read("one_domain_foreach_lang", false); @@ -92,7 +93,7 @@ class URL } else { // Get the base URL - $base_url = ConfigQuery::read('base_url', null); + $base_url = ConfigQuery::read('base_url', $request->getSchemeAndHttpHost()); $err_msg_part = sprintf('base_url for lang %s', $lang->getCode()); }