From 2e0e68b57f456da6272b1af291620b34874ee01d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 14 Oct 2016 08:41:52 +0200 Subject: [PATCH 1/2] log error when setting timezone to UTC fails (#26354) Signed-off-by: Roeland Jago Douma --- lib/base.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/base.php b/lib/base.php index 0c4acab8fd2..bcb81662c0e 100644 --- a/lib/base.php +++ b/lib/base.php @@ -625,7 +625,9 @@ class OC { @ini_set('display_errors', 0); @ini_set('log_errors', 1); - date_default_timezone_set('UTC'); + if(!date_default_timezone_set('UTC')) { + \OC::$server->getLogger()->error('Could not set timezone to UTC'); + }; //try to configure php to enable big file uploads. //this doesn´t work always depending on the webserver and php configuration. From f920153f163299d3ee99d07307b9af7f16b2041d Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Mon, 24 Oct 2016 15:03:18 +0200 Subject: [PATCH 2/2] Throw exception because the logger causes session issues anyway that early in the request cycle Signed-off-by: Morris Jobke --- lib/base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/base.php b/lib/base.php index bcb81662c0e..883c1f54b17 100644 --- a/lib/base.php +++ b/lib/base.php @@ -626,7 +626,7 @@ class OC { @ini_set('log_errors', 1); if(!date_default_timezone_set('UTC')) { - \OC::$server->getLogger()->error('Could not set timezone to UTC'); + throw new \RuntimeException('Could not set timezone to UTC'); }; //try to configure php to enable big file uploads.