ZF-3110: Zend/Locale/Data.php (Line 974) should check that the array index exists


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) {".


Please give the used locale, the called code and the responding error message for reproduction.

Locale: fr_FR

Summary of relevant parts of backtrace: Currency.php, line 302: Zend_Locale_Data::getContent("fr_FR", "currencytoname", "USD")

Currency.php, line 87:
    Zend_Currency->getShortName("USD", "fr_FR")

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)

Fixed with r9227

Updating for the 1.6.0 release.