Browse Source

Functions: Updates for PHP 8.1

fusionate 2 years ago
parent
commit
5ad4edb143
1 changed files with 2 additions and 2 deletions
  1. 2 2
      resources/functions.php

+ 2 - 2
resources/functions.php

@@ -2118,14 +2118,14 @@ function number_pad($number,$n) {
 					}
 					}
 					break;
 					break;
 				case 'exists':
 				case 'exists':
-					return is_array($_SESSION['persistent'][$_SERVER['PHP_SELF']]) && @sizeof($_SESSION['persistent'][$_SERVER['PHP_SELF']]) != 0 ? true : false;
+					return !empty($_SESSION['persistent']) && is_array($_SESSION['persistent'][$_SERVER['PHP_SELF']]) && @sizeof($_SESSION['persistent'][$_SERVER['PHP_SELF']]) != 0 ? true : false;
 					break;
 					break;
 				case 'load':
 				case 'load':
 					// $array is expected to be the name of the array to create containing the key / value pairs
 					// $array is expected to be the name of the array to create containing the key / value pairs
 					if ($array && !is_array($array)) {
 					if ($array && !is_array($array)) {
 						global $$array;
 						global $$array;
 					}
 					}
-					if (is_array($_SESSION['persistent'][$_SERVER['PHP_SELF']]) && @sizeof($_SESSION['persistent'][$_SERVER['PHP_SELF']]) != 0) {
+					if (!empty($_SESSION['persistent']) && is_array($_SESSION['persistent'][$_SERVER['PHP_SELF']]) && @sizeof($_SESSION['persistent'][$_SERVER['PHP_SELF']]) != 0) {
 						foreach ($_SESSION['persistent'][$_SERVER['PHP_SELF']] as $key => $value) {
 						foreach ($_SESSION['persistent'][$_SERVER['PHP_SELF']] as $key => $value) {
 							if ($key != 'XID' && $key != 'ACT' && $key != 'RET') {
 							if ($key != 'XID' && $key != 'ACT' && $key != 'RET') {
 								if ($array && !is_array($array)) {
 								if ($array && !is_array($array)) {