浏览代码

[svn r12249] Check if the array is not empty before doing so many operations on it.

Yannick Warnier 18 年之前
父节点
当前提交
13e7d9fc51
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      main/inc/lib/tablesort.lib.php

+ 1 - 0
main/inc/lib/tablesort.lib.php

@@ -85,6 +85,7 @@ class TableSort
 	 */
 	function sort_table($data, $column = 0, $direction = SORT_ASC, $type = SORT_REGULAR)
 	{
+		if(!is_array($data) or count($data)==0){return array();}
 		switch ($type)
 		{
 			case SORT_REGULAR :