Skip to content

Commit

Permalink
More sanity checking.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Jan 22, 2015
1 parent c6bdd43 commit 509900e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions framework/Mapi/lib/Horde/Mapi/Timezone.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,12 @@ public static function getOffsetsFromDate(Horde_Date $date)
);

$timezone = $date->toDateTime()->getTimezone();
list($std, $dst) = self::_getTransitions($timezone, $date);
if ($std) {
// If transition parsing failed, we won't have a multi-element array.
$transitions = self::_getTransitions($timezone, $date);
if (!empty($transitions)) {
list($std, $dst) = self::_getTransitions($timezone, $date);
}
if (!empty($std)) {
$offsets['bias'] = $std['offset'] / 60 * -1;
if ($dst) {
$offsets = self::_generateOffsetsForTransition($offsets, $std, 'std');
Expand Down

0 comments on commit 509900e

Please sign in to comment.