From e9867d24b944b1c9c71c2c6c214cb80ba628c0b9 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Tue, 21 Mar 2023 17:53:07 +0100 Subject: [PATCH] Do not use each() anymore (breaks on PHP 8) --- src/phorkie/Repository/LinkbackReceiver.php | 3 ++- www/setup.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/phorkie/Repository/LinkbackReceiver.php b/src/phorkie/Repository/LinkbackReceiver.php index c808f45..1bb4664 100644 --- a/src/phorkie/Repository/LinkbackReceiver.php +++ b/src/phorkie/Repository/LinkbackReceiver.php @@ -46,7 +46,8 @@ class Repository_LinkbackReceiver $remoteCloneUrl = $remoteTitle = null; if (count($arRemoteCloneUrls)) { reset($arRemoteCloneUrls); - list($remoteCloneUrl, $remoteTitle) = each($arRemoteCloneUrls); + $remoteCloneUrl = key($arRemoteCloneUrls); + $remoteTitle = current($arRemoteCloneUrls); } $remoteid = 'fork-' . uniqid(); //check if we already know this remote diff --git a/www/setup.php b/www/setup.php index 909306f..634a11a 100644 --- a/www/setup.php +++ b/www/setup.php @@ -99,7 +99,7 @@ HTM; if (array_sum($GLOBALS['phorkie']['cfgfiles']) == 0) { //no config file loaded reset($GLOBALS['phorkie']['cfgfiles']); - list($cfgFilePath, ) = each($GLOBALS['phorkie']['cfgfiles']); + $cfgFilePath = key($GLOBALS['phorkie']['cfgfiles']); $cfgFilePath = Tools::foldPath($cfgFilePath); $cfgFileTemplate = htmlspecialchars( -- 2.30.2