propperly evaluate lang from REQUEST

This commit is contained in:
Uwe Steinmann 2019-04-17 08:29:19 +02:00
parent 43c15ff399
commit 0f38a3dff6
2 changed files with 7 additions and 4 deletions

View File

@ -151,11 +151,9 @@ class SeedDMS_Controller_Login extends SeedDMS_Controller_Common {
$user->clearLoginFailures(); $user->clearLoginFailures();
// Capture the user's language and theme settings. // Capture the user's language and theme settings.
if (isset($_REQUEST["lang"]) && strlen($_REQUEST["lang"])>0 && is_numeric(array_search($_REQUEST["lang"],getLanguages())) ) { if ($lang) {
$lang = $_REQUEST["lang"];
$user->setLanguage($lang); $user->setLanguage($lang);
} } else {
else {
$lang = $user->getLanguage(); $lang = $user->getLanguage();
if (strlen($lang)==0) { if (strlen($lang)==0) {
$lang = $settings->_language; $lang = $settings->_language;

View File

@ -65,6 +65,11 @@ if(isset($_POST['pwd'])) {
} }
} }
$lang = '';
if(isset($_REQUEST["lang"]) && strlen($_REQUEST["lang"])>0 && is_numeric(array_search($_REQUEST["lang"],getLanguages())) ) {
$lang = (string) $_REQUEST["lang"];
}
$session = new SeedDMS_Session($db); $session = new SeedDMS_Session($db);
// TODO: by the PHP manual: The superglobals $_GET and $_REQUEST are already decoded. // TODO: by the PHP manual: The superglobals $_GET and $_REQUEST are already decoded.