Skip to content

Commit

Permalink
Fix using en-GB as default language on odd cases
Browse files Browse the repository at this point in the history
Fixes showing administrator side always in en-GB if $_POST has no lang
key.
  • Loading branch information
renekorss committed Jan 21, 2016
1 parent 98aa6f5 commit 22f5598
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions libraries/cms/application/administrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,13 @@ public function login($credentials, $options = array())

if (!($result instanceof Exception))
{
$lang = $this->input->getCmd('lang', 'en-GB');
$lang = preg_replace('/[^A-Z-]/i', '', $lang);
$this->setUserState('application.lang', $lang);
$lang = $this->input->getCmd('lang');

if (strlen($lang)>0)
{
$lang = preg_replace('/[^A-Z-]/i', '', $lang);
$this->setUserState('application.lang', $lang);
}

static::purgeMessages();
}
Expand Down

0 comments on commit 22f5598

Please sign in to comment.