[HttpFoundation] fixed locale accessors in Session class
This commit is contained in:
parent
4134b1fd90
commit
9588860716
@ -21,7 +21,6 @@ use Symfony\Component\HttpFoundation\SessionStorage\SessionStorageInterface;
|
||||
class Session implements \Serializable
|
||||
{
|
||||
protected $storage;
|
||||
protected $locale;
|
||||
protected $attributes;
|
||||
protected $oldFlashes;
|
||||
protected $started;
|
||||
@ -171,7 +170,7 @@ class Session implements \Serializable
|
||||
$this->start();
|
||||
}
|
||||
|
||||
return $this->getAttribute('_locale');
|
||||
return $this->attributes['_locale'];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -181,9 +180,11 @@ class Session implements \Serializable
|
||||
*/
|
||||
public function setLocale($locale)
|
||||
{
|
||||
if ($this->locale != $locale) {
|
||||
$this->setAttribute('_locale', $locale);
|
||||
if (false === $this->started) {
|
||||
$this->start();
|
||||
}
|
||||
|
||||
$this->attributes['_locale'] = $locale;
|
||||
}
|
||||
|
||||
public function getFlashMessages()
|
||||
|
Reference in New Issue
Block a user