diff --git a/include/class.timezone.php b/include/class.timezone.php index 79789f4f4872712fecc1060368a7f723224aabc0..272444b458130a7f6eff208708ab1e0b48c15743 100644 --- a/include/class.timezone.php +++ b/include/class.timezone.php @@ -166,7 +166,15 @@ class DbTimezone { // Attempt to fetch timezone direct from the database $TZ = db_timezone(); - // SYSTEM does not describe a time zone + // Forbid timezone abbreviations like 'CDT' + if (!in_array($TZ, array('UTC', 'GMT')) && strpos($TZ, '/') === false) + // Attempt to lookup based on the abbreviation + if (!($TZ = timezone_name_from_abbr($TZ))) + // Abbreviation doesn't point to anything valid + return false; + + // SYSTEM does not describe a time zone, ensure we have a valid zone + // by attempting to create an instance of DateTimeZone() try { new DateTimeZone($TZ); return $TZ;