diff --git a/library/Zend/Locale/Format.php b/library/Zend/Locale/Format.php index c937b92cf5..8a5c8d5232 100644 --- a/library/Zend/Locale/Format.php +++ b/library/Zend/Locale/Format.php @@ -516,6 +516,10 @@ public static function isNumber($input, array $options = []) if (!self::_getUniCodeSupport()) { trigger_error("Sorry, your PCRE extension does not support UTF8 which is needed for the I18N core", E_USER_NOTICE); } + + if($input === null ) { + return FALSE; + } $options = self::_checkOptions($options) + self::$_options; @@ -524,7 +528,10 @@ public static function isNumber($input, array $options = []) $regexs = Zend_Locale_Format::_getRegexForType('decimalnumber', $options); $regexs = array_merge($regexs, Zend_Locale_Format::_getRegexForType('scientificnumber', $options)); - if (!empty($input) && ($input[0] == $symbols['decimal'])) { + + $firstChar = substr($input,0,1); + + if (!empty($input) && ($firstChar == $symbols['decimal'])) { $input = 0 . $input; } foreach ($regexs as $regex) {