From 8be6552235eb374cfdca2526724360ce38230b49 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 7 May 2020 13:46:42 +0200 Subject: [PATCH] Added check if language isset in COOKIE in hlp_language_helper --- application/helpers/hlp_language_helper.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/application/helpers/hlp_language_helper.php b/application/helpers/hlp_language_helper.php index 1678a4102..f5f164573 100644 --- a/application/helpers/hlp_language_helper.php +++ b/application/helpers/hlp_language_helper.php @@ -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