Add a check to make sure $data is safe

This commit is contained in:
nathangray 2016-07-20 09:21:43 -06:00 committed by Ralf Becker
parent b087295fd0
commit 7f919ed0e3

View File

@ -583,10 +583,13 @@ class resources_bo
); );
$only_keys = 'res_id,name'; $only_keys = 'res_id,name';
$data = $this->so->search(array(),$only_keys,$order_by='name',$extra_cols='',$wildcard='%',$empty,$op='OR',$limit,$filter); $data = $this->so->search(array(),$only_keys,$order_by='name',$extra_cols='',$wildcard='%',$empty,$op='OR',$limit,$filter);
if(is_array($data) && $data)
{
foreach($data as $resource) foreach($data as $resource)
{ {
$resources[$resource['res_id']] = $resource['name']; $resources[$resource['res_id']] = $resource['name'];
} }
}
return $resources; return $resources;
} }