From 05f0c0a3d444bc9a77f8453036c094ecf30b45ec Mon Sep 17 00:00:00 2001 From: SNH_NL Date: Tue, 7 Apr 2020 15:41:32 +0200 Subject: [PATCH 1/2] Fix 'No date part in '' found. Upgrade from 1.9.0.x to 1.9.2.2 https://magento.stackexchange.com/questions/93202/no-date-part-in-found-when-upgrading-from-magento-1-9-0-x-to-1-9-2-2/99914 --- lib/Zend/Locale/Format.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Zend/Locale/Format.php b/lib/Zend/Locale/Format.php index 909831300c1..9965973cc8b 100644 --- a/lib/Zend/Locale/Format.php +++ b/lib/Zend/Locale/Format.php @@ -907,7 +907,7 @@ private static function _parseDate($date, $options) $split = false; preg_match_all('/\d+/u', $number, $splitted); - if (count($splitted[0]) == 0) { + if (!empty($number) && count($splitted[0]) == 0) { self::_setEncoding($oenc); #require_once 'Zend/Locale/Exception.php'; throw new Zend_Locale_Exception("No date part in '$date' found."); From e3ecc0d72bf43d4b966266568611a83de7ff7158 Mon Sep 17 00:00:00 2001 From: Colin Mollenhour Date: Thu, 14 May 2020 19:32:50 -0400 Subject: [PATCH 2/2] Avoid PHP warning but still throw exception on unmatched regex. --- lib/Zend/Locale/Format.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Zend/Locale/Format.php b/lib/Zend/Locale/Format.php index 9965973cc8b..3f9ef0a450f 100644 --- a/lib/Zend/Locale/Format.php +++ b/lib/Zend/Locale/Format.php @@ -905,9 +905,8 @@ private static function _parseDate($date, $options) // split number parts $split = false; - preg_match_all('/\d+/u', $number, $splitted); - if (!empty($number) && count($splitted[0]) == 0) { + if ( ! preg_match_all('/\d+/u', $number, $splitted)) { self::_setEncoding($oenc); #require_once 'Zend/Locale/Exception.php'; throw new Zend_Locale_Exception("No date part in '$date' found.");