From: Chuck Hagenbuch Date: Thu, 21 May 2009 00:49:42 +0000 (-0400) Subject: don't cast scalars; Horde_Date can use the fact that they're strings to do some corre... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=9c4d0fab837640f879bb7fd9a01e1314f431efc2;p=horde.git don't cast scalars; Horde_Date can use the fact that they're strings to do some corrective measures --- 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; } } }