ZF-12382: Zend_Locale doesn't return default locale when browser didn't send HTTP_ACCEPT_LANGUAGE


I think there is still situation when exception on line 1045 could happen.

Function getBrowser returns empty array (lines 433-435) and if Zend_Locale is called like $locale = new Zend_Locale(Zend_Locale::BROWSER); than on line 1033 is check which probably should ensure there is always some locale returned BUT "if (($locale === 'auto') or ($locale === null))" second condition is not TRUE for empty array there should be "if (($locale === 'auto') or ($locale == null))" or "if (($locale === 'auto') or (empty($locale)) " finaly on line 1038 "$locale = key($locale);" it makes $locale = NULL which than throws the exception.


No comments to display