N°4517 - PHP 8.1: Fix deprecated notice for null value passed to string parameter of native PHP functions

This commit is contained in:
Molkobain
2023-02-24 21:30:21 +01:00
parent 5c9eb7fa38
commit 61bd8b6bb4
3 changed files with 3 additions and 3 deletions

View File

@@ -2271,7 +2271,7 @@ class utils
$aParams = array(); $aParams = array();
foreach(explode('&', $sQuery) as $sChunk) foreach(explode('&', $sQuery) as $sChunk)
{ {
$aParts = explode('=', $sChunk); $aParts = explode('=', $sChunk ?? '');
if (count($aParts) != 2) continue; if (count($aParts) != 2) continue;
$aParams[$aParts[0]] = urldecode($aParts[1]); $aParams[$aParts[0]] = urldecode($aParts[1]);
} }

View File

@@ -110,7 +110,7 @@ class apcFile
*/ */
static public function GetCacheFileName($sKey = '') static public function GetCacheFileName($sKey = '')
{ {
$sPath = str_replace(array(' ', '/', '\\', '.'), '-', $sKey); $sPath = str_replace(array(' ', '/', '\\', '.'), '-', $sKey ?? '');
return utils::GetCachePath().'apc-emul/'.$sPath; return utils::GetCachePath().'apc-emul/'.$sPath;
} }

View File

@@ -242,7 +242,7 @@ class InlineImage extends DBObject
public static function OnFormCancel($sTempId): bool public static function OnFormCancel($sTempId): bool
{ {
// Protection against unfortunate massive delete of inline images when a null temp ID is passed // 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( IssueLog::Trace('OnFormCancel "error" $sTempId is null or empty', LogChannels::INLINE_IMAGE, array(
'$sTempId' => $sTempId, '$sTempId' => $sTempId,
'$sUser' => UserRights::GetUser(), '$sUser' => UserRights::GetUser(),