From c4760090fd368e415023f5ef4ad4ec6a620a249b Mon Sep 17 00:00:00 2001 From: Olaf Conradi Date: Sat, 28 Dec 2013 21:43:24 +0100 Subject: Add default timezone when system one is missing Suppresses all the PHP warnings in the error logging. --- conf/common.inc.php | 4 ++++ conf/config.php | 3 +++ 2 files changed, 7 insertions(+) (limited to 'conf') diff --git a/conf/common.inc.php b/conf/common.inc.php index 165c73f..506134d 100644 --- a/conf/common.inc.php +++ b/conf/common.inc.php @@ -4,3 +4,7 @@ require_once 'config.php'; $CONFIG['webdir'] = preg_replace('/\/[a-z\.]+$/', '', $_SERVER['SCRIPT_FILENAME']); $CONFIG['weburl'] = preg_replace('/(?<=\/)[a-z\.]+$/', '', $_SERVER['SCRIPT_NAME']); + +if (!ini_get('date.timezone')) { + date_default_timezone_set($CONFIG['default_timezone']); +} diff --git a/conf/config.php b/conf/config.php index 6c0572e..7107841 100644 --- a/conf/config.php +++ b/conf/config.php @@ -66,6 +66,9 @@ $CONFIG['detail-heigth'] = 350; # disabled: NULL $CONFIG['socket'] = NULL; +# system default timezone when not set +$CONFIG['default_timezone'] = 'UTC'; + # load local configuration if (file_exists(dirname(__FILE__).'/config.local.php')) -- cgit v1.1