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

Issue Type: Bug Created: 2008-04-14T15:23:26.000+0000 Last Updated: 2008-09-02T10:39:17.000+0000 Status: Resolved Fix version(s): - 1.6.0 (02/Sep/08)

Reporter: Anders Petersen (anpeters) Assignee: Thomas Weidner (thomas) Tags: - Zend_Locale

Related issues: Attachments:


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


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

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)

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.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.