Fix PHP 7.2 warning "PHP Warning: count() Parameter must be an array or object ..."

This commit is contained in:
nathangray 2018-12-10 10:12:08 -07:00
parent d15841e3eb
commit 5a0cd76250

View File

@ -1703,7 +1703,7 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
{ {
$sortResult = $sortResultwH; $sortResult = $sortResultwH;
} }
$rowsFetched['rowsFetched'] = count($sortResult['header']); $rowsFetched['rowsFetched'] = $sortResult['header'] ? count($sortResult['header']) : 0;
if (empty($rowsFetched['messages'])) $rowsFetched['messages'] = $rowsFetched['rowsFetched']; if (empty($rowsFetched['messages'])) $rowsFetched['messages'] = $rowsFetched['rowsFetched'];
//error_log(__METHOD__.__LINE__.' Rows fetched:'.$rowsFetched.' Data:'.array2string($sortResult)); //error_log(__METHOD__.__LINE__.' Rows fetched:'.$rowsFetched.' Data:'.array2string($sortResult));