From 9c4d0fab837640f879bb7fd9a01e1314f431efc2 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Wed, 20 May 2009 20:49:42 -0400 Subject: [PATCH] don't cast scalars; Horde_Date can use the fact that they're strings to do some corrective measures --- .../Date_Parser/lib/Horde/Date/Parser/Locale/Base/Scalar.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base/Scalar.php b/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base/Scalar.php index 0130dc308..d74236a52 100644 --- a/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base/Scalar.php +++ b/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base/Scalar.php @@ -31,7 +31,7 @@ class Horde_Date_Parser_Locale_Base_Scalar { if (preg_match($this->scalarRegex, $token->word)) { if (!in_array($postToken, $this->timeSignifiers)) { - return (int)$token->word; + return $token->word; } } } @@ -39,8 +39,8 @@ class Horde_Date_Parser_Locale_Base_Scalar public function scanForDays($token, $postToken) { if (preg_match($this->dayRegex, $token->word)) { - if ((int)$token->word <= 31 && !in_array($postToken, $this->timeSignifiers)) { - return (int)$token->word; + if ($token->word <= 31 && !in_array($postToken, $this->timeSignifiers)) { + return $token->word; } } } @@ -48,8 +48,8 @@ class Horde_Date_Parser_Locale_Base_Scalar public function scanForMonths($token, $postToken) { if (preg_match($this->monthRegex, $token->word)) { - if ((int)$token->word <= 12 && !in_array($postToken, $this->timeSignifiers)) { - return (int)$token->word; + if ($token->word <= 12 && !in_array($postToken, $this->timeSignifiers)) { + return $token->word; } } } @@ -58,7 +58,7 @@ class Horde_Date_Parser_Locale_Base_Scalar { if (preg_match($this->yearRegex, $token->word)) { if (!in_array($postToken, $this->timeSignifiers)) { - return (int)$token->word; + return $token->word; } } } -- 2.11.0