fix numerizer _andition() error
authorChuck Hagenbuch <chuck@horde.org>
Mon, 25 May 2009 03:03:39 +0000 (23:03 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Mon, 25 May 2009 03:03:39 +0000 (23:03 -0400)
framework/Date_Parser/lib/Horde/Support/Numerizer/Locale/Base.php

index b6cc380..0a1908e 100644 (file)
@@ -125,7 +125,7 @@ class Horde_Support_Numerizer_Locale_Base
     {
         while (true) {
             if (preg_match('/(\d+)( | and )(\d+)(?=[^\w]|$)/i', $string, $sc, PREG_OFFSET_CAPTURE)) {
-                if (preg_match('/and/', $sc[2][0]) || $sc[1][0] > $sc[3][0]) {
+                if (preg_match('/and/', $sc[2][0]) || (strlen($sc[1][0]) > strlen($sc[3][0]))) {
                     $string = substr($string, 0, $sc[1][1]) . ((int)$sc[1][0] + (int)$sc[3][0]) . substr($string, $sc[3][1] + strlen($sc[3][0]));
                     continue;
                 }