diff --git a/app/bridges/bridges.php b/app/bridges/bridges.php index 007c6f4e90..e214f02ee8 100644 --- a/app/bridges/bridges.php +++ b/app/bridges/bridges.php @@ -47,14 +47,14 @@ $text = $language->get(); //get the http post data - if (is_array($_POST['bridges'])) { + if (isset($_POST['bridges']) && is_array($_POST['bridges'])) { $action = $_POST['action']; $search = $_POST['search']; $bridges = $_POST['bridges']; } //process the http post data by action - if ($action != '' && is_array($bridges) && @sizeof($bridges) != 0) { + if (isset($action) && $action != '' && is_array($bridges) && @sizeof($bridges) != 0) { switch ($action) { case 'copy': if (permission_exists('bridge_add')) { @@ -81,8 +81,8 @@ } //get order and order by - $order_by = $_GET["order_by"]; - $order = $_GET["order"]; + $order_by = $_GET["order_by"] ?? ''; + $order = $_GET["order"] ?? ''; //add the search string if (isset($_GET["search"])) { @@ -98,7 +98,7 @@ //get the count $sql = "select count(bridge_uuid) from v_bridges "; - if ($_GET['show'] == "all" && permission_exists('bridge_all')) { + if (isset($_GET['show']) && $_GET['show'] == "all" && permission_exists('bridge_all')) { if (isset($sql_search)) { $sql .= "where ".$sql_search; } @@ -115,9 +115,9 @@ //prepare to page the results $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; - $param = $search ? "&search=".$search : null; - $param = ($_GET['show'] == 'all' && permission_exists('bridge_all')) ? "&show=all" : null; - $page = is_numeric($_GET['page']) ? $_GET['page'] : 0; + $param = !empty($search) ? "&search=".$search : null; + $param = (isset($_GET['show']) && $_GET['show'] == 'all' && permission_exists('bridge_all')) ? "&show=all" : null; + $page = isset($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : 0; list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page); list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true); $offset = $rows_per_page * $page; @@ -156,14 +156,14 @@ } echo "