Skip to content

Commit 752c17b

Browse files
author
Pascal Meunier
committed
bug fix: time_zone used to be a number but now can be a time zone name; guard numberical calculation obsolete code to prevent errors
1 parent ff34b5f commit 752c17b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • core/components/com_events/site/controllers

core/components/com_events/site/controllers/events.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1966,7 +1966,11 @@ public function saveTask()
19661966
$tz = 'Pacific/Kiritimati';
19671967
break;
19681968
default:
1969-
$tz = timezone_name_from_abbr('', $row->time_zone * 3600, -1);
1969+
// Newer events store an IANA zone name (ex: 'US/Eastern') rather than
1970+
// a numeric offset, so only convert when we really have a number.
1971+
$tz = is_numeric($row->time_zone)
1972+
? timezone_name_from_abbr('', $row->time_zone * 3600, -1)
1973+
: $row->time_zone;
19701974
}
19711975

19721976
// Publish immediately only for users who can manage publication state

0 commit comments

Comments
 (0)