1.23.2 Timeline with "in set" filter bug fix

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
timcraig
Posts: 195
Joined: Mon Dec 10, 2007 5:53 pm
Location: San Jose, CA

1.23.2 Timeline with "in set" filter bug fix

Post 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>
batnator
Posts: 10
Joined: Thu Jan 31, 2008 10:17 am
Location: Berlin / Germany

Post by batnator »

I have reproduced this bug in our system, thanks for the fix.
Post Reply