Page 1 of 1

1.23.2 Timeline with "in set" filter bug fix

Posted: Wed Mar 12, 2008 6:08 am
by timcraig
I came across a bug in 1.23.2.
To reproduce the bug:
1) Open the Event Filter window.
2) Setup a filter that uses the "in set" operator with a comma delimited list. (e.g. "Monitor Id" -- "in set" -- "1,2,3).
3) Press the 'Submit' button to bring up the Events window.
4) Click on the "Show Timeline" link in the events window to bring up the Timeline window.
5) Perform a "Pan Left", "Pan Right", "Zoom In" or "Zoom Out" on the timeline.
The "Timeline" window becomes an error message reporting an SQL error.


To fix this bug, I changed every instance of "$filter_query" to "urldecode($filter_query)" on lines 831,1207,1208 and 1209 in the file zm_html_view_timeline.php (located in zm web folder).

In cut-and-paste terms, the changes are:

change line 831 from:

Code: Select all

window.location='<?= $PHP_SELF ?>?view=<?= $view ?><?= $filter_query ?>&min_time='+min_time+'&max_time='+max_time;
to:

Code: Select all

window.location='<?= $PHP_SELF ?>?view=<?= $view ?><?= urldecode($filter_query) ?>&min_time='+min_time+'&max_time='+max_time;
change the following 3 lines starting at 1207 from:

Code: Select all

<a href="<?= $PHP_SELF ?>?view=<?= $view ?><?= $filter_query ?>&mid_time=<?= urlencode($min_time) ?>&range=<?= $range ?>" title="<?= $zmSlangPanLeft ?>"><</a>&nbsp;&nbsp;
<a href="<?= $PHP_SELF ?>?view=<?= $view ?><?= $filter_query ?>&mid_time=<?= urlencode($mid_time) ?>&range=<?= (int)($range*$maj_x_scale['zoomout']) ?>" title="<?= $zmSlangZoomOut ?>">-</a>&nbsp;&nbsp;
<a href="<?= $PHP_SELF ?>?view=<?= $view ?><?= $filter_query ?>&min_time=<?= urlencode($mid_time) ?>&range=<?= $range ?>" title="<?= $zmSlangPanRight ?>">></a>
to:

Code: Select all

<a href="<?= $PHP_SELF ?>?view=<?= $view ?><?= urldecode($filter_query) ?>&mid_time=<?= urlencode($min_time) ?>&range=<?= $range ?>" title="<?= $zmSlangPanLeft ?>"><</a>&nbsp;&nbsp;
<a href="<?= $PHP_SELF ?>?view=<?= $view ?><?= urldecode($filter_query) ?>&mid_time=<?= urlencode($mid_time) ?>&range=<?= (int)($range*$maj_x_scale['zoomout']) ?>" title="<?= $zmSlangZoomOut ?>">-</a>&nbsp;&nbsp;
<a href="<?= $PHP_SELF ?>?view=<?= $view ?><?= urldecode($filter_query) ?>&min_time=<?= urlencode($mid_time) ?>&range=<?= $range ?>" title="<?= $zmSlangPanRight ?>">></a>

Posted: Thu Mar 13, 2008 12:00 pm
by batnator
I have reproduced this bug in our system, thanks for the fix.