From bb3e393d3a2ddf8d5201b8dfc440a893e2d167b4 Mon Sep 17 00:00:00 2001 From: hahn <axel.hahn@iml.unibe.ch> Date: Mon, 22 Aug 2022 14:19:55 +0200 Subject: [PATCH] remove array_key_exists() --- public_html/deployment/pages/act_phase.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public_html/deployment/pages/act_phase.php b/public_html/deployment/pages/act_phase.php index cd27fa58..647c274a 100644 --- a/public_html/deployment/pages/act_phase.php +++ b/public_html/deployment/pages/act_phase.php @@ -20,7 +20,7 @@ require_once("./classes/config-replacement.class.php"); $oPrj = new project($aParams["prj"]); $sOut = ''; -if (array_key_exists("par3", $aParams)) { +if (isset($aParams["par3"])) { $sPhase = $aParams["par3"]; } @@ -76,7 +76,7 @@ if ($sPhase) { foreach ($aReplacements as $sFile => $aFields) { $tTplFile = basename($sFile); - $bFileInForeman = $aReplacementsForeman && array_key_exists($tTplFile, $aReplacementsForeman); + $bFileInForeman = $aReplacementsForeman && isset($aReplacementsForeman[$tTplFile]); $sDivIdFile='div4file-'.md5($sFile); $sOutReplace.='<h4>' . @@ -90,7 +90,7 @@ if ($sPhase) { ; // --- check: does this file in foreman exist? - if (!array_key_exists($tTplFile, $aReplacementsForeman)){ + if (!isset($aReplacementsForeman[$tTplFile])){ if ($aReplacementsForeman){ $sOutReplace.=$oHtml->getBox('error', t('foreman-error-template-unknown')); $aWarnings[]=$tTplFile.': '.t('foreman-error-template-unknown'); @@ -101,7 +101,7 @@ if ($sPhase) { // --- check: target file was set? $aTable=array('header'=>array(), 'body'=>array()); if ($bFileInForeman){ - if ($aReplacementsForeman && array_key_exists('target', $aReplacementsForeman[$tTplFile])){ + if ($aReplacementsForeman && isset($aReplacementsForeman[$tTplFile]['target'])){ $sTd='<strong>'.$oHtml->getIcon('file-target') . $aReplacementsForeman[$tTplFile]['target'].'</strong>'; } else { if ($bFileInForeman){ @@ -121,7 +121,7 @@ if ($sPhase) { // and check if they exist in foreman if (count($aFields)) { foreach ($aFields as $sField){ - if ($aReplacementsForeman && array_key_exists($sField, $aReplacementsForeman[$tTplFile]['replace'])){ + if ($aReplacementsForeman && isset($aReplacementsForeman[$tTplFile]['replace'][$sField])){ $sTd=$aReplacementsForeman[$tTplFile]['replace'][$sField]; } else { if ($bFileInForeman){ -- GitLab