From 1dd3ba166ea64fc158f6d7442a928ff85ac33c01 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Thu, 21 May 2009 10:36:12 -0400 Subject: [PATCH] don't touch numbers that begin with 0, since they weren't generated by numerize() and might be times --- framework/Date_Parser/lib/Horde/Support/Numerizer/Locale/Base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..9d314addc 100644 --- a/framework/Date_Parser/lib/Horde/Support/Numerizer/Locale/Base.php +++ b/framework/Date_Parser/lib/Horde/Support/Numerizer/Locale/Base.php @@ -124,7 +124,7 @@ class Horde_Support_Numerizer_Locale_Base protected function _andition($string) { while (true) { - if (preg_match('/(\d+)( | and )(\d+)(?=[^\w]|$)/i', $string, $sc, PREG_OFFSET_CAPTURE)) { + if (preg_match('/([1-9]\d*)( | and )([1-9]\d*)(?=[^\w]|$)/i', $string, $sc, PREG_OFFSET_CAPTURE)) { if (preg_match('/and/', $sc[2][0]) || $sc[1][0] > $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; -- 2.11.0