[horde] bug in datemap.inc

Andrew Morgan morgan at orst.edu
Thu Mar 13 15:37:18 PST 2003


I just upgraded to Horde v2.2.1 and I noticed that a bug from v2.1 is
still present in lib/Data.php.  The same bug is present in HEAD, as far as
I can tell.  It's my fault for not catching this during the RC cycle.

The patch should be self explanatory.

	Andy
-------------- next part --------------
diff -ur horde.orig/lib/Data.php horde/lib/Data.php
--- horde.orig/lib/Data.php	Thu Mar 13 15:31:05 2003
+++ horde/lib/Data.php	Thu Mar 13 15:33:19 2003
@@ -227,8 +227,10 @@
                 return $date;
             }
             if ($format == 'ampm') {
-                if (strpos($dates[count($dates)-1], 'pm') !== false) {
-                    $dates[0]++;
+                if (strpos(strtolower($dates[count($dates)-1]), 'pm') !== false) {
+                    if ($dates[0] !== '12') {
+                        $dates[0] += 12;
+                    }
                 } elseif ($dates[0] == '12') {
                     $dates[0] = '0';
                 }


More information about the horde mailing list