From 61bd8b6bb4de7c6ad76c37041143774e32ecb145 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Fri, 24 Feb 2023 21:30:21 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B04517=20-=20PHP=208.1:=20Fix=20deprecated?= =?UTF-8?q?=20notice=20for=20null=20value=20passed=20to=20string=20paramet?= =?UTF-8?q?er=20of=20native=20PHP=20functions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/utils.inc.php | 2 +- core/apc-emulation.php | 2 +- core/inlineimage.class.inc.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/utils.inc.php b/application/utils.inc.php index dc2f2d1d8..a5103aefb 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -2271,7 +2271,7 @@ class utils $aParams = array(); foreach(explode('&', $sQuery) as $sChunk) { - $aParts = explode('=', $sChunk); + $aParts = explode('=', $sChunk ?? ''); if (count($aParts) != 2) continue; $aParams[$aParts[0]] = urldecode($aParts[1]); } diff --git a/core/apc-emulation.php b/core/apc-emulation.php index 7f6e9e3ae..1a8829494 100644 --- a/core/apc-emulation.php +++ b/core/apc-emulation.php @@ -110,7 +110,7 @@ class apcFile */ static public function GetCacheFileName($sKey = '') { - $sPath = str_replace(array(' ', '/', '\\', '.'), '-', $sKey); + $sPath = str_replace(array(' ', '/', '\\', '.'), '-', $sKey ?? ''); return utils::GetCachePath().'apc-emul/'.$sPath; } diff --git a/core/inlineimage.class.inc.php b/core/inlineimage.class.inc.php index ec71d82a0..f8cfcae48 100644 --- a/core/inlineimage.class.inc.php +++ b/core/inlineimage.class.inc.php @@ -242,7 +242,7 @@ class InlineImage extends DBObject public static function OnFormCancel($sTempId): bool { // Protection against unfortunate massive delete of inline images when a null temp ID is passed - if (strlen($sTempId) === 0) { + if (utils::IsNullOrEmptyString($sTempId)) { IssueLog::Trace('OnFormCancel "error" $sTempId is null or empty', LogChannels::INLINE_IMAGE, array( '$sTempId' => $sTempId, '$sUser' => UserRights::GetUser(),