ZF-7500: Zend_Locale::setDefault throws Exception with broken string


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