ZF-7500: Zend_Locale::setDefault throws Exception with broken string
Description
When providing an invalid locale code (for instance "en-US" instead of "en_US"), Zend_Locale::setDefault throws the exception with text "Unknown locale 'Array' can not be set as default!".
It should state the unknown locale to pinpoint the issue.
$locale = explode('_', (string) $locale); // $locals now contains an array
if (isset(self::$_localeData[$locale[0]]) === true) {
self::$_default = array($locale[0] => $quality);
} else {
require_once 'Zend/Locale/Exception.php';
throw new Zend_Locale_Exception("Unknown locale '" . (string) $locale . "' can not be set as default!"); // casting array to string results in "Array"
}
Comments
Posted by Thomas Weidner (thomas) on 2009-08-09T01:18:31.000+0000
Fixed with r17478