From 3df7502dcf8dfe888e54fdf5ac9d4c13ef204bcd Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 3 Feb 2018 08:42:12 -0500 Subject: [PATCH] Use defaults for setting session variables in index.php --- index.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/index.php b/index.php index af493f201..ef8440099 100644 --- a/index.php +++ b/index.php @@ -166,19 +166,10 @@ if (! x($_SESSION, 'authenticated')) { $a->page['htmlhead'] = ''; $a->page['end'] = ''; +$_SESSION['sysmsg'] = defaults($_SESSION, 'sysmsg' , []); +$_SESSION['sysmsg_info'] = defaults($_SESSION, 'sysmsg_info' , []); +$_SESSION['last_updated'] = defaults($_SESSION, 'last_updated', []); -if (x($_SESSION, 'sysmsg') === false) { - $_SESSION['sysmsg'] = []; -} - -if (x($_SESSION, 'sysmsg_info') === false) { - $_SESSION['sysmsg_info'] = []; -} - -// Array for informations about last received items -if (x($_SESSION, 'last_updated') === false) { - $_SESSION['last_updated'] = []; -} /* * check_config() is responsible for running update scripts. These automatically * update the DB schema whenever we push a new one out. It also checks to see if