ZF-3110: Zend/Locale/Data.php (Line 974) should check that the array index exists
Description
Line 974 in Zend/Locale/Data.php should check that the array index exists before comparing to avoid causing "Undefined index" notices. I only noticed this because I used Zend Locale as a standalone module, and use my own error handler (which shows notices).
Example fix: Change from "if ($val[$key] != $value) {" to "if (isset($val[$key]) && $val[$key] != $value) {".
Comments
Posted by Thomas Weidner (thomas) on 2008-04-14T15:38:45.000+0000
Please give the used locale, the called code and the responding error message for reproduction.
Posted by Anders Petersen (anpeters) on 2008-04-14T15:59:47.000+0000
Locale: fr_FR
Summary of relevant parts of backtrace: Currency.php, line 302: Zend_Locale_Data::getContent("fr_FR", "currencytoname", "USD")
Zend_Currency->__construct("USD", Object(Zend_Locale))
Error messages (repeated for all the currencies I use, USD, GBP, CAD, EUR & NOK): Undefined index: AZN (error type 8 in /Zend/Locale/Data.php on line 974) Undefined index: EQE (error type 8 in /Zend/Locale/Data.php on line 974)
Posted by Thomas Weidner (thomas) on 2008-04-15T12:07:03.000+0000
Fixed with r9227
Posted by Wil Sinclair (wil) on 2008-09-02T10:39:17.000+0000
Updating for the 1.6.0 release.