From 5d4b861156ce37882150c6acf384342d2353c262 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Apr 2014 17:09:38 +0200 Subject: [PATCH] Fix: Try/catch Conflicts: htdocs/core/class/conf.class.php --- htdocs/core/class/conf.class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 957bec47088..378d831861f 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -204,7 +204,16 @@ class Conf // If you can't set timezone of your PHP, set this constant. Better is to set it to UTC. // In future, this constant will be forced to 'UTC' so PHP server timezone will not have effect anymore. //$this->global->MAIN_SERVER_TZ='Europe/Paris'; - if (! empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ != 'auto') date_default_timezone_set($this->global->MAIN_SERVER_TZ); + if (! empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ != 'auto') + { + try { + date_default_timezone_set($this->global->MAIN_SERVER_TZ); + } + catch(Exception $e) + { + dol_syslog("Error: Bad value for parameter MAIN_SERVER_TZ=".$this->global->MAIN_SERVER_TZ, LOG_ERR); + } + } // Object $mc if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled))