From 6e774a58fe6c509e2cd16d222ed414edc9f10b17 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 6 Feb 2021 00:12:15 +0300 Subject: more php8 fixes mostly related to login --- include/functions.php | 2 +- include/login_form.php | 6 +++--- include/sessions.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index 0ec0ba30b..2db559a92 100644 --- a/include/functions.php +++ b/include/functions.php @@ -148,7 +148,7 @@ $lang = _TRANSLATION_OVERRIDE_DEFAULT; } - if ($_SESSION["uid"] && get_schema_version() >= 120) { + if (!empty($_SESSION["uid"]) && get_schema_version() >= 120) { $pref_lang = get_pref("USER_LANGUAGE", $_SESSION["uid"]); if ($pref_lang && $pref_lang != 'auto') { diff --git a/include/login_form.php b/include/login_form.php index 586d6fe78..0e8f8389e 100755 --- a/include/login_form.php +++ b/include/login_form.php @@ -99,7 +99,7 @@ - + @@ -110,7 +110,7 @@ onchange="UtilityApp.fetchProfiles()" onfocus="UtilityApp.fetchProfiles()" onblur="UtilityApp.fetchProfiles()" - required="1" value="" /> + required="1" value="" />
@@ -122,7 +122,7 @@ onchange="UtilityApp.fetchProfiles()" onfocus="UtilityApp.fetchProfiles()" onblur="UtilityApp.fetchProfiles()" - value=""/> + value=""/>
diff --git a/include/sessions.php b/include/sessions.php index 75d4671e8..15725c1f9 100644 --- a/include/sessions.php +++ b/include/sessions.php @@ -46,7 +46,7 @@ } $pdo = Db::pdo(); - if ($_SESSION["uid"]) { + if (!empty($_SESSION["uid"])) { if (!defined('_SESSION_SKIP_UA_CHECKS') && $_SESSION["user_agent"] != sha1($_SERVER['HTTP_USER_AGENT'])) { $_SESSION["login_error_msg"] = __("Session failed to validate (UA changed)."); -- cgit v1.2.3-54-g00ecf