浏览代码

Merge pull request #1528 from moteus/no_menu_warning

Fix. warning about using NULL as first argument in `foreach`.
FusionPBX 9 年之前
父节点
当前提交
64c698ff3f
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      resources/classes/menu.php

+ 2 - 1
resources/classes/menu.php

@@ -390,7 +390,7 @@
 					$db = $this->db;
 
 				//database ojbect does not exist return immediately
-					if (!$db) { return; }
+					if (!$db) { return Array(); }
 
 				//if there are no groups then set the public group
 					if (!isset($_SESSION['groups'])) {
@@ -435,6 +435,7 @@
 
 				//save the menu into an array
 					$x = 0;
+					$a = Array();
 					foreach($result as $row) {
 						//add the row to the array
 							$a[$x] = $row;