From: Chuck Hagenbuch Date: Mon, 25 May 2009 03:03:39 +0000 (-0400) Subject: fix numerizer _andition() error X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=76d2003a35dd9019620b9bce45bde75314e33f28;p=horde.git fix numerizer _andition() error --- diff --git a/framework/Date_Parser/lib/Horde/Support/Numerizer/Locale/Base.php b/framework/Date_Parser/lib/Horde/Support/Numerizer/Locale/Base.php index b6cc380a5..0a1908ef4 100644 --- a/framework/Date_Parser/lib/Horde/Support/Numerizer/Locale/Base.php +++ b/framework/Date_Parser/lib/Horde/Support/Numerizer/Locale/Base.php @@ -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; }