merged branch stof/issue_3053 (PR #3054)
Commits
-------
9bc41d0
[HttpFoundation] Fixed #3053
Discussion
----------
[HttpFoundation] Fixed #3053
This commit is contained in:
commit
4f1edb50d8
@ -931,7 +931,7 @@ class Request
|
||||
{
|
||||
$preferredLanguages = $this->getLanguages();
|
||||
|
||||
if (null === $locales) {
|
||||
if (empty($locales)) {
|
||||
return isset($preferredLanguages[0]) ? $preferredLanguages[0] : null;
|
||||
}
|
||||
|
||||
|
@ -719,6 +719,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$request = new Request();
|
||||
$this->assertEquals('', $request->getPreferredLanguage());
|
||||
$this->assertEquals('', $request->getPreferredLanguage(array()));
|
||||
$this->assertEquals('fr', $request->getPreferredLanguage(array('fr')));
|
||||
$this->assertEquals('fr', $request->getPreferredLanguage(array('fr', 'en')));
|
||||
$this->assertEquals('en', $request->getPreferredLanguage(array('en', 'fr')));
|
||||
|
Reference in New Issue
Block a user