Skip to content
Snippets Groups Projects
Commit bb3e393d authored by hahn's avatar hahn
Browse files

remove array_key_exists()

parent 9c7d26b1
Branches
No related tags found
1 merge request!29remove array_key_exists()
......@@ -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){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment