Prevent from libkolabxml errors on Etc/GMT timezone (Bifrost#T15706)

This commit is contained in:
Aleksander Machniak 2016-12-27 04:13:56 -05:00
parent dc3ea3d942
commit bbe88f6637

View file

@ -234,7 +234,10 @@ abstract class kolab_format
if (!$dateonly) if (!$dateonly)
$result->setTime($datetime->format('G'), $datetime->format('i'), $datetime->format('s')); $result->setTime($datetime->format('G'), $datetime->format('i'), $datetime->format('s'));
if ($tz && in_array($tz->getName(), array('UTC', 'GMT', '+00:00', 'Z'))) { // libkolabxml throws errors on some deprecated timezone names
$utc_aliases = array('UTC', 'GMT', '+00:00', 'Z', 'Etc/GMT');
if ($tz && in_array($tz->getName(), $utc_aliases)) {
$result->setUTC(true); $result->setUTC(true);
} }
else if ($tz !== false) { else if ($tz !== false) {