From ca5239387be92a9dde551fe042389127d24d281d Mon Sep 17 00:00:00 2001 From: pifou25 Date: Sun, 26 May 2024 18:19:34 +0200 Subject: [PATCH] fix deprecated notices --- core/class/eqLogic.class.php | 5 ++++- core/class/jeeObject.class.php | 3 +++ core/class/scenario.class.php | 3 +++ core/class/utils.class.php | 2 +- core/php/getResource.php | 2 +- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/core/class/eqLogic.class.php b/core/class/eqLogic.class.php index 8b14b22a1a..272a8306be 100644 --- a/core/class/eqLogic.class.php +++ b/core/class/eqLogic.class.php @@ -494,6 +494,9 @@ public static function toHumanReadable($_input) { } public static function fromHumanReadable($_input) { + if(empty($_input)){ + return $_input; + } $isJson = false; if (is_json($_input)) { $isJson = true; @@ -525,7 +528,7 @@ public static function fromHumanReadable($_input) { return $_input; } $text = $_input; - preg_match_all("/#\[(.*?)\]\[(.*?)\]#/", $text, $matches); + preg_match_all( "/#\[(.*?)\]\[(.*?)\]#/", $text, $matches); if (count($matches) == 3) { $countMatches = count($matches[0]); for ($i = 0; $i < $countMatches; $i++) { diff --git a/core/class/jeeObject.class.php b/core/class/jeeObject.class.php index efb641ad12..37775f9722 100644 --- a/core/class/jeeObject.class.php +++ b/core/class/jeeObject.class.php @@ -147,6 +147,9 @@ public static function toHumanReadable($_input) { } public static function fromHumanReadable($_input) { + if(empty($_input)){ + return $_input; + } $isJson = false; if (is_json($_input)) { $isJson = true; diff --git a/core/class/scenario.class.php b/core/class/scenario.class.php index befd464ba0..3dbf43b851 100644 --- a/core/class/scenario.class.php +++ b/core/class/scenario.class.php @@ -660,6 +660,9 @@ public static function toHumanReadable($_input) { * @return string|object|array return value will depends on $_input received */ public static function fromHumanReadable($_input) { + if(empty($_input)){ + return $_input; + } $isJson = false; if (is_json($_input)) { $isJson = true; diff --git a/core/class/utils.class.php b/core/class/utils.class.php index dadef62f97..0d59121aec 100644 --- a/core/class/utils.class.php +++ b/core/class/utils.class.php @@ -226,7 +226,7 @@ public static function encrypt($plaintext, $password = null) { } public static function decrypt($ciphertext, $password = null) { - if ($ciphertext === '') { + if (empty($ciphertext)) { return null; } if ($password == null) { diff --git a/core/php/getResource.php b/core/php/getResource.php index 9faef3ff57..f70ba961ef 100644 --- a/core/php/getResource.php +++ b/core/php/getResource.php @@ -42,7 +42,7 @@ header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $lastModified) . ' GMT'); header('Etag: ' . $etagFile); header('Cache-Control: public'); - if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $lastModified || $etagHeader == $etagFile) { + if (($ifModifiedSince !== false && $ifModifiedSince == $lastModified) || $etagHeader == $etagFile) { header('HTTP/1.1 304 Not Modified'); exit; }