Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.9.0
-
Fix Version/s: 1.9.1
-
Component/s: Zend_Locale
-
Labels:None
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"
}
Fixed with r17478