6.0.0-beta1
8/11/25

[#13455] [kronolith] PHP ERROR: Undefined offset: 1 [pid 8052 on line 169 of "/usr/share/php/Horde/Timezone/Zone.php"]
Summary [kronolith] PHP ERROR: Undefined offset: 1 [pid 8052 on line 169 of "/usr/share/php/Horde/Timezone/Zone.php"]
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners jan (at) horde (dot) org
Requester skhorde (at) smail (dot) inf (dot) fh-bonn-rhein-sieg (dot) de
Created 08/20/2014 (4009 days ago)
Due
Updated 08/20/2014 (4009 days ago)
Assigned
Resolved 08/20/2014 (4009 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
08/20/2014 04:37:06 PM Jan Schneider Comment #2
Assigned to Jan Schneider
State ⇒ Resolved
Reply to this comment
commit 241ac91ad1436797cb80344648d173aee5fb062a
Author: Jan Schneider <jan@horde.org>
Date:   Wed Aug 20 18:28:50 2014 +0200

     Strip trailing whitespace before comments too.

  framework/Timezone/lib/Horde/Timezone.php                |    2 +-
  framework/Timezone/package.xml                           |   12 ++++--
  framework/Timezone/test/Horde/Timezone/IcalendarTest.php |   21 -----------
  framework/Timezone/test/Horde/Timezone/Mock.php          |   27 
++++++++++++++
  framework/Timezone/test/Horde/Timezone/ParseTest.php     |   16 ++++++++
  5 files changed, 52 insertions(+), 26 deletions(-)
  create mode 100644 framework/Timezone/test/Horde/Timezone/Mock.php
  create mode 100644 framework/Timezone/test/Horde/Timezone/ParseTest.php

http://github.com/horde/horde/commit/241ac91ad1436797cb80344648d173aee5fb062a
08/20/2014 07:37:44 AM skhorde (at) smail (dot) inf (dot) fh-bonn-rhein-sieg (dot) de Comment #1
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ [kronolith] PHP ERROR: Undefined offset: 1 [pid 8052 on line 169 of "/usr/share/php/Horde/Timezone/Zone.php"]
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
Reply to this comment
I'm getting this error quite often from

  $this->_info[$line] = array(
   0 => '-0:36:32',
   1 => '-',
   2 => 'LMT',
   3 => '1912',
   4 => 'Jan',
   5 => '1',
   6 => '',
)

In line 140 of Horde/Timezone/Zone.php $date[3] == '', therefore line 
141 matches nothing.

         $time = isset($date[3]) && $date[3] != '-' ? $date[3] : 0;

Dunno if the data in the array makes any sense at all, but how about 
to change:

         $time = isset($date[3]) && $date[3] != '-' ? $date[3] : 0;
         preg_match('/(\d+)(?::(\d+))?(?::(\d+))?(w|s|u)?/', $time, $match);
         if (!isset($match[2])) {

into

!       $time = isset($date[3])? $date[3] : 0;
         preg_match('/(\d+)(?::(\d+))?(?::(\d+))?(w|s|u)?/', $time, $match);
+       if (!isset($match[1])) {
+           $match[1] = 0;
+       }
          if (!isset($match[2])) {

Saved Queries