@@ -217,7 +217,7 @@ public function addRow()
217217 {
218218 $ tmpRow = $ this ->_prepArgs (func_get_args ());
219219
220- if ($ this ->syncRowsWithHeading && ! empty ( $ this ->heading ) ) {
220+ if ($ this ->syncRowsWithHeading && $ this ->heading !== [] ) {
221221 // each key has an index
222222 $ keyIndex = array_flip (array_keys ($ this ->heading ));
223223
@@ -303,7 +303,7 @@ public function generate($tableData = null)
303303 {
304304 // The table data can optionally be passed to this function
305305 // either as a database result object or an array
306- if (! empty ( $ tableData) ) {
306+ if ($ tableData !== null && $ tableData !== [] ) {
307307 if ($ tableData instanceof BaseResult) {
308308 $ this ->_setFromDBResult ($ tableData );
309309 } elseif (is_array ($ tableData )) {
@@ -312,7 +312,7 @@ public function generate($tableData = null)
312312 }
313313
314314 // Is there anything to display? No? Smite them!
315- if (empty ( $ this ->heading ) && $ this ->rows === []) {
315+ if ($ this ->heading === [] && $ this ->rows === []) {
316316 return 'Undefined table data ' ;
317317 }
318318
@@ -333,7 +333,7 @@ public function generate($tableData = null)
333333 }
334334
335335 // Is there a table heading to display?
336- if (! empty ( $ this ->heading ) ) {
336+ if ($ this ->heading !== [] ) {
337337 $ headerTag = null ;
338338
339339 if (preg_match ('/(<)(td|th)(?=\h|>)/i ' , $ this ->template ['heading_cell_start ' ], $ matches ) === 1 ) {
@@ -399,7 +399,7 @@ public function generate($tableData = null)
399399 }
400400
401401 // Any table footing to display?
402- if (! empty ( $ this ->footing ) ) {
402+ if ($ this ->footing !== [] ) {
403403 $ footerTag = null ;
404404
405405 if (preg_match ('/(<)(td|th)(?=\h|>)/i ' , $ this ->template ['footing_cell_start ' ], $ matches )) {
@@ -458,7 +458,7 @@ public function clear()
458458 protected function _setFromDBResult ($ object )
459459 {
460460 // First generate the headings from the table column names
461- if ($ this ->autoHeading && empty ( $ this ->heading ) ) {
461+ if ($ this ->autoHeading && $ this ->heading === [] ) {
462462 $ this ->heading = $ this ->_prepArgs ($ object ->getFieldNames ());
463463 }
464464
@@ -476,7 +476,7 @@ protected function _setFromDBResult($object)
476476 */
477477 protected function _setFromArray ($ data )
478478 {
479- if ($ this ->autoHeading && empty ( $ this ->heading ) ) {
479+ if ($ this ->autoHeading && $ this ->heading === [] ) {
480480 $ this ->heading = $ this ->_prepArgs (array_shift ($ data ));
481481 }
482482
0 commit comments