From fffdc9b114ce32fac800377582cd8bbd58c95242 Mon Sep 17 00:00:00 2001 From: rMalie Date: Thu, 29 Dec 2011 16:11:04 +0000 Subject: [PATCH] // Set timezone in new installer git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11900 b9a71923-0436-4b27-9f14-aed3839534dd --- config/config.inc.php | 3 +-- install-new/classes/controllerHttp.php | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config/config.inc.php b/config/config.inc.php index 4b9ff2473..7fbbdce33 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -113,8 +113,7 @@ $defaultCountry = new Country(Configuration::get('PS_COUNTRY_DEFAULT'), Configur Context::getContext()->country = $defaultCountry; /* It is not safe to rely on the system's timezone settings, and this would generate a PHP Strict Standards notice. */ -if (function_exists('date_default_timezone_set')) - @date_default_timezone_set(Configuration::get('PS_TIMEZONE')); +@date_default_timezone_set(Configuration::get('PS_TIMEZONE')); /* Instantiate cookie */ $cookieLifetime = (time() + (((int)Configuration::get('PS_COOKIE_LIFETIME_BO') > 0 ? (int)Configuration::get('PS_COOKIE_LIFETIME_BO') : 1)* 3600)); diff --git a/install-new/classes/controllerHttp.php b/install-new/classes/controllerHttp.php index 35c88441f..7d5cd10a0 100644 --- a/install-new/classes/controllerHttp.php +++ b/install-new/classes/controllerHttp.php @@ -106,6 +106,10 @@ abstract class InstallControllerHttp if (!$session->last_step || !in_array($session->last_step, self::$steps)) $session->last_step = self::$steps[0]; + // Set timezone + if ($session->shop_timezone) + @date_default_timezone_set($session->shop_timezone); + // Get current step (check first if step is changed, then take it from session) if (Tools::getValue('step')) {