Skip to content
Snippets Groups Projects
Commit 3cf4c46c authored by Björn Schießle's avatar Björn Schießle
Browse files

catch unknown timezone and fall-back to UTC

parent 76bdd6bc
No related branches found
No related tags found
No related merge requests found
......@@ -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');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment