From 3cf4c46c43e7ee7221eb26173bd530c3dd97d0b4 Mon Sep 17 00:00:00 2001
From: Bjoern Schiessle <schiessle@owncloud.com>
Date: Tue, 8 Oct 2013 20:42:35 +0200
Subject: [PATCH] catch unknown timezone and fall-back to UTC

---
 lib/private/log/owncloud.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/private/log/owncloud.php b/lib/private/log/owncloud.php
index 528c6bc38be..5123ba7f175 100644
--- a/lib/private/log/owncloud.php
+++ b/lib/private/log/owncloud.php
@@ -52,7 +52,11 @@ class OC_Log_Owncloud {
 			// default to ISO8601
 			$format = OC_Config::getValue('logdateformat', 'Y-m-d H:i:s');
 			$logtimezone=OC_Config::getValue( "logtimezone", 'UTC' );
-			$timezone = new DateTimeZone($logtimezone);
+			try {
+				$timezone = new DateTimeZone($logtimezone);
+			} catch (Exception $e) {
+				$timezone = new DateTimeZone('UTC');
+			}
 			$time = new DateTime(null, $timezone);
 			$entry=array('app'=>$app, 'message'=>$message, 'level'=>$level, 'time'=> $time->format($format));
 			$handle = @fopen(self::$logFile, 'a');
-- 
GitLab