From: Bjoern Schiessle Date: Tue, 8 Oct 2013 18:42:35 +0000 (+0200) Subject: catch unknown timezone and fall-back to UTC X-Git-Tag: v6.0.0alpha2~54^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3cf4c46c43e7ee7221eb26173bd530c3dd97d0b4;p=nextcloud-server.git catch unknown timezone and fall-back to UTC --- 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');