fix: Clean up errors in the webui (#4438)

This commit is contained in:
Tony Murray
2016-09-15 02:46:26 -05:00
committed by Neil Lathwood
parent 83d7bbdd1b
commit 36f6338ad6
6 changed files with 22 additions and 15 deletions

View File

@@ -56,7 +56,7 @@ if (!empty($filter_device)) {
foreach ($results as $data) {
$tmp_output .= '"<option value=\"'.$data['hostname'].'\""+';
if ($data['hostname'] == $vars['hostname']) {
if (isset($vars['hostname']) && $data['hostname'] == $vars['hostname']) {
$tmp_output .= '"selected"+';
}
$tmp_output .= '">'.$data['hostname'].'</option>"+';
@@ -67,7 +67,7 @@ if (!empty($filter_device)) {
';
}
if (empty($filter_device)) {
if (empty($filter_device) && isset($_POST['hostname'])) {
$filter_device = mres($_POST['hostname']);
}
@@ -96,7 +96,7 @@ $tmp_output .= '
rowCount: ['. $results_limit .', 25,50,100,250,-1],
';
if ($no_form !== true) {
if (isset($no_form) && $no_form !== true) {
$tmp_output .= '
templates: {
header: searchbar
@@ -109,8 +109,8 @@ $tmp_output .= '
{
return {
id: "graylog",
hostname: "' . $filter_device . '",
range: "' . mres($_POST['range']) . '"
hostname: "' . (isset($filter_device) ? $filter_device : '') . '",
range: "' . (isset($_POST['range']) ? mres($_POST['range']) : '') . '"
};
},
url: "ajax_table.php",