Issues

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

Issue Type: Bug Created: 2012-08-21T14:51:43.000+0000 Last Updated: 2012-08-21T14:51:43.000+0000 Status: Open Fix version(s): Reporter: Ales Seifert (alesak) Assignee: Thomas Weidner (thomas) Tags: - Zend_Locale

Related issues: Attachments:

Description

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.

Comments

No comments to display

Have you found an issue?

See the Overview section for more details.

Copyright

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

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

Contacts