User tests: Successful: Unsuccessful:
fixes #8906
Fixes showing administrator side always in en-GB
if $_POST
has no lang
key.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
This works but I rather suggest this code:
if (!($result instanceof Exception))
{
$lang = $this->input->getCmd('lang', null);
if (!is_null($lang))
{
$lang = preg_replace('/[^A-Z-]/i', '', $lang);
$this->setUserState('application.lang', $lang);
}
static::purgeMessages();
}
Except evidently if it does not work with your susoschin (last version?)
@infograf768 Thanks. Tested, works with latest suhosin.
Not sure why you want a default value of null
instead of just not giving any default value. Imho
$lang = $this->input->getCmd('lang');
if ($lang)
{
$lang = preg_replace('/[^A-Z-]/i', '', $lang);
$this->setUserState('application.lang', $lang);
}
should do the same.
One could also put the preg_replace before the if, so in case the result of the sanitising(?) ends up being empty no UserState is going to be set.
So I would do
$lang = $this->input->getCmd('lang');
$lang = preg_replace('/[^A-Z-]/i', '', $lang);
if ($lang)
{
$this->setUserState('application.lang', $lang);
}
But I may miss something as I don't know the code in question in detail.
@Bakual
I was mocking up the code in
https://github.com/joomla/joomla-cms/blob/staging/installation/application/web.php#L383-L392
But I see no reason indeed in this case (as we have a default) to not use your proposal.
@Bakual @infograf768 I updated code.
I have tested this item successfully on 7ebda6c
One more tester to get this in 3.5.0
I have tested this item successfully on 7ebda6c
I have not tested this item.
I have not tested this as I can not replicate the issue in order to be able to confirm this PR resolves anything
@brianteeman Easiest way to test this, is to delete language select input with developer tools, so that $_POST
has no lang
key. Without this patch, it will default to en-GB
despite different default language.
@brianteeman
No need to have the issue to test.
As long as this works for who has the issue AND works in all cases for the others (i.e. all of us).
Tests should include for the user login:
User set to use default admin language
User set to a specific admin language
Login with a different language than those above.
As long as this works for who has the issue AND works in all cases for the others (i.e. all of us).
Thats fine but I am not going to personally test something that I cannot replicate
@renekorss I have removed your test report from the count of successful tests. It is assumed that code you submit works ;)
This still needs one more tester
@brianteeman Sounds logical :)
I have tested this item successfully on 7ebda6c
Test OK
Status | Pending | ⇒ | Ready to Commit |
2 tests OK. RTC
Labels |
Added:
?
|
Milestone |
Added: |
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-02-16 17:42:55 |
Closed_By | ⇒ | roland-d |
Labels |
Removed:
?
|
@renekorss see renekorss#5