Skip to content

Commit

Permalink
Merge pull request #393 from RotherOSS/issue-388-Z
Browse files Browse the repository at this point in the history
Issue #388: explicit check for 'Z' in _StringToHash()
  • Loading branch information
bschmalhofer authored Aug 25, 2020
2 parents 0c835fb + c87fd09 commit 333ec9b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Kernel/System/DateTime.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1965,8 +1965,15 @@ sub _StringToHash {
};

# Check if the rest 'OffsetOrTZ' is an offset or timezone.
# If isn't an offset consider it a timezone
if ( $OffsetOrTZ ne 'Z' && $OffsetOrTZ !~ m/[+-]\d{2}:?(?:\d{2})?/i ) {
# Explicit support for Zulu time.
# Then ff isn't an offset consider it a timezone.
if ( $OffsetOrTZ eq 'Z' ) {
return {
%{$DateTimeHash},
TimeZone => 'UTC',
};
}
elsif ( $OffsetOrTZ !~ m/[+-]\d{2}:?(?:\d{2})?/i ) {

# Make sure the time zone is valid. Otherwise, assume UTC.
if ( !$Self->IsTimeZoneValid( TimeZone => $OffsetOrTZ ) ) {
Expand Down

0 comments on commit 333ec9b

Please sign in to comment.