[kronolith] offset 1 patch..

Chris Bowlby excalibur at hub.org
Thu Feb 13 11:59:39 PST 2003


Hi All, 

 Each time I've done an update to Kronolith, I seem to get a re-curring
offset 1 error, this is the error:

Notice: Undefined offset: 1 in
/usr/local/www/horde/kronolith/lib/Kronolith.php on line 1002

I found that the issue is due to not checking for a length > 0 on a
string before the explode takes place (which is what is spitting out the
error), here's a patch to fix it.

--- Kronolith.php.orig  Thu Feb 13 15:54:47 2003
+++ Kronolith.php       Thu Feb 13 15:54:35 2003
@@ -999,8 +999,10 @@
                 $colorString[$calendar_id] = $_colorString;
                 $cols = explode('|', $colorString[$calendar_id]);
                 foreach ($cols as $col) {
-                    list($key, $val) = explode(':', $col);
-                    $colors[$calendar_id][$key] = $val;
+                    if (strlen($col) > 0) {
+                        list($key, $val) = explode(':', $col);
+                        $colors[$calendar_id][$key] = $val;
+                    }
                 }
             }
         }

-- 
Chris Bowlby <excalibur at hub.org>
Hub.Org Networking Services



More information about the kronolith mailing list