Skip to content
Snippets Groups Projects
Commit 1bead7cc authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

task-1462: replace usage of ARRAY_FILTER_USE_BOTH for older php versions

parent 382ea023
No related branches found
No related tags found
No related merge requests found
...@@ -383,10 +383,13 @@ class ForemanApi { ...@@ -383,10 +383,13 @@ class ForemanApi {
} }
$aReturn=array(); $aReturn=array();
foreach($aTmp as $aItem){ foreach($aTmp as $aItem){
$aReturn[] = array_filter($aItem, function($key) { $aReturnitem=array();
return array_search($key, $this->_aRequest['response']) !==false; foreach($this->_aRequest['response'] as $sKey){
}, ARRAY_FILTER_USE_KEY if (array_key_exists($sKey, $aItem)){
); $aReturnitem[$sKey]=$aItem[$sKey];
}
}
$aReturn[] = $aReturnitem;
} }
return ($bIsList==1) return ($bIsList==1)
? $aReturn ? $aReturn
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment