Added check if language isset in COOKIE in hlp_language_helper

This commit is contained in:
Cris
2020-05-07 13:46:42 +02:00
parent b7a9f139af
commit 8be6552235
@@ -35,6 +35,12 @@ function getUserLanguage($language = null)
{
$language = $_SESSION[LANG_SESSION_CURRENT_LANGUAGE]; // then use it
}
// Else if the language is present in the cookie and it is valid
elseif (isset($_COOKIE[LANG_SESSION_CURRENT_LANGUAGE]) && !isEmptyString($_COOKIE[LANG_SESSION_CURRENT_LANGUAGE]))
{
$language = $_COOKIE[LANG_SESSION_CURRENT_LANGUAGE];
}
// Otherwise checks if the user is authenticated to retrieve the users's language
// NOTE: this helper could be called when the user is NOT logged in the system
// therefore is checked if the user is logged