Skip to content

Commit cd594c6

Browse files
committed
Resolving Issue #91
Page become blank after collecting multiple host syslog info
1 parent c9919f0 commit cd594c6

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ The sylog plugin has been in development for well over a decade with increasing
7777

7878
## ChangeLog
7979

80+
--- develop ---
81+
* issue#91: Page become blank after collecting multiple host syslog info
82+
8083
--- 2.2 ---
8184
* feature: Allow for reprocess message per rule
8285
* issue#66: Filter for All Programs can not work well

functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,8 @@ function sql_hosts_where($tab) {
583583
$hostfilter = '';
584584
$hostfilter_log = '';
585585

586-
if (!isempty_request_var('host') && get_request_var('host') != 'null') {
587-
$hostarray = explode(',', get_request_var('host'));
586+
if (!isempty_request_var('host') && get_nfilter_request_var('host') != 'null') {
587+
$hostarray = explode(',', trim(get_nfilter_request_var('host')));
588588
if ($hostarray[0] != '0') {
589589
foreach($hostarray as $host_id) {
590590
input_validate_input_number($host_id);

syslog.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,9 @@ function syslog_statistics() {
190190
'options' => array('options' => 'sanitize_search_string')
191191
),
192192
'host' => array(
193-
'filter' => FILTER_CALLBACK,
193+
'filter' => FILTER_VALIDATE_IS_NUMERIC_LIST,
194194
'pageset' => true,
195195
'default' => '',
196-
'options' => array('options' => 'sanitize_search_string')
197196
),
198197
'facility' => array(
199198
'filter' => FILTER_CALLBACK,
@@ -645,10 +644,9 @@ function syslog_request_validation($current_tab, $force = false) {
645644
'default' => '-1'
646645
),
647646
'host' => array(
648-
'filter' => FILTER_CALLBACK,
647+
'filter' => FILTER_VALIDATE_IS_NUMERIC_LIST,
649648
'pageset' => true,
650-
'default' => '0',
651-
'options' => array('options' => 'sanitize_search_string')
649+
'default' => '',
652650
),
653651
'efacility' => array(
654652
'filter' => FILTER_CALLBACK,
@@ -1280,7 +1278,7 @@ function timeshiftFilterRight() {
12801278
<td>
12811279
<?php print __('Devices', 'syslog');?>
12821280
</td>
1283-
<td class='even'>
1281+
<td>
12841282
<select id='host' multiple style='display:none; width: 150px; overflow: scroll;'>
12851283
<?php if ($tab == 'syslog') { ?><option id='host_all' value='0'<?php if (get_request_var('host') == 'null' || get_request_var('host') == '0' || $reset_multi) { ?> selected<?php } ?>><?php print __('Show All Devices', 'syslog');?></option><?php } else { ?>
12861284
<option id='host_all' value='0'<?php if (get_request_var('host') == 'null' || get_request_var('host') == 0 || $reset_multi) { ?> selected<?php } ?>><?php print __('Show All Logs', 'syslog');?></option>
@@ -1294,15 +1292,16 @@ function timeshiftFilterRight() {
12941292
$hosts_where
12951293
ORDER BY host");
12961294

1297-
$selected = explode(' ', get_request_var('host'));
1295+
$selected = explode(',', get_request_var('host'));
1296+
12981297
if (cacti_sizeof($hosts)) {
12991298
foreach ($hosts as $host) {
13001299
if (!is_ipaddress($host['host'])) {
13011300
$parts = explode('.', $host['host']);
13021301
$host['host'] = $parts[0];
13031302
}
13041303

1305-
print "<option value='" . $host["host_id"] . "'";
1304+
print "<option value='" . $host['host_id'] . "'";
13061305
if (cacti_sizeof($selected)) {
13071306
if (in_array($host['host_id'], $selected)) {
13081307
print ' selected';

0 commit comments

Comments
 (0)