From: Marcin Haba Date: Fri, 22 Jul 2022 01:20:54 +0000 (+0200) Subject: baculum: Fix #2653 PHP warning about wrong array_key_exists() parameter in session... X-Git-Tag: Release-13.0.1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=181b2e2bbe382f1c55e9707a4d4e11c15ab157ca;p=thirdparty%2Fbacula.git baculum: Fix #2653 PHP warning about wrong array_key_exists() parameter in session record --- diff --git a/gui/baculum/protected/Common/Class/SessionRecord.php b/gui/baculum/protected/Common/Class/SessionRecord.php index 2dc7457f5..4074538fb 100644 --- a/gui/baculum/protected/Common/Class/SessionRecord.php +++ b/gui/baculum/protected/Common/Class/SessionRecord.php @@ -89,7 +89,8 @@ class SessionRecord extends CommonModule implements SessionItem { $fp = fopen($sessfile, 'r'); if (flock($fp, LOCK_SH, $wouldblock)) { $content = file_get_contents($sessfile); - $GLOBALS['sess'] = unserialize($content); + $ucont = unserialize($content); + $GLOBALS['sess'] = is_array($ucont) ? $ucont : array(); flock($fp, LOCK_UN); } else { $emsg = 'Unable to shared lock ' . $sessfile;