Skip to content

Commit 738768e

Browse files
committed
Resolving Issue #28
Flowview filters not searchable using some international characters
1 parent 87f45eb commit 738768e

3 files changed

Lines changed: 22 additions & 11 deletions

File tree

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,19 @@ Got any ideas or complaints, please see the Cacti forums or GitHub for a resolut
4242

4343
# Changelog
4444

45+
--- develop ---
46+
47+
* issue#28: Flowview filters not searchable using some international characters
48+
4549
--- 2.1 ---
50+
4651
* issue: Prepare for sunrise theme in 1.1.17
4752
* issue: Clean up the filter logic to preserve values
4853
* issue: Make the graph size auto-detect screen size
4954
* issue: Make reports sort properly
5055

5156
--- 2.0 ---
57+
5258
* feature: Support for Cacti 1.0
5359
* feature: Support for Ugroup Plugin
5460
* feature: Use either the OS' DNS or Alternate
@@ -63,10 +69,12 @@ Got any ideas or complaints, please see the Cacti forums or GitHub for a resolut
6369
* issue: Update text domains for i18n
6470

6571
--- 1.1 ---
72+
6673
* issue: FlowView Settings were hidden for some reason
6774
* issue: flow-capture script incomplete
6875

6976
--- 1.0 ---
77+
7078
* compat: Making compatible with 0.8.7g
7179
* feature: Allow sending emails on demand
7280
* feature: Add SaveAs, Delete, Update to UI
@@ -80,28 +88,33 @@ Got any ideas or complaints, please see the Cacti forums or GitHub for a resolut
8088
* issue: Rename 'Devices' to 'Listeners'
8189

8290
--- 0.6 ---
91+
8392
* compat: Now only PA 2.0 compatible
8493
* issue: Fix for IE and saving Queries
8594
* issue: Fix for Error when no devices
8695

8796
--- 0.5 ---
97+
8898
* feature: Add flow-tools replacement startup script to allow launching of multiple processes based upon devices added
8999
* feature: Add Saved Queries
90100
* feature: Change Sort field to be drop downs with column names
91101
* feature: Add ability to schedule and email out Netflow Scans
92102
* issue: Fix issue with start and stop times close to midnight not loading the proper days data
93103

94104
--- 0.4 ---
105+
95106
* issue: Minor fix for when using flow path "/"
96107
* issue: Fix Cacti 0.8.7 Compatibility
97108

98109
--- 0.3 ---
110+
99111
* feature: Add time support for relative times (NOW, -1 HOUR, -2 DAYS, -10 MINTUES) Must leave Date blank for these to work properly
100112
* feature: Add device name to path if present
101113

102114
--- 0.2 ---
115+
103116
* feature: Add DNS Support
104117

105118
--- 0.1 ---
106-
* Initial release
107119

120+
* Initial release

flowview_devices.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,9 @@ function show_devices () {
350350
'default' => '1'
351351
),
352352
'filter' => array(
353-
'filter' => FILTER_CALLBACK,
353+
'filter' => FILTER_DEFAULT,
354354
'pageset' => true,
355-
'default' => '',
356-
'options' => array('options' => 'sanitize_search_string')
355+
'default' => ''
357356
),
358357
'sort_column' => array(
359358
'filter' => FILTER_CALLBACK,
@@ -370,7 +369,7 @@ function show_devices () {
370369
validate_store_request_vars($filters, 'sess_fvd');
371370
/* ================= input validation ================= */
372371

373-
$sql_where = (get_request_var('filter') != '' ? "name LIKE '%" . get_request_var('filter') . "%'":'');
372+
$sql_where = (get_request_var('filter') != '' ? 'WHERE name LIKE ' . db_qstr('%' . get_request_var('filter') . '%'):'');
374373
$rows = read_config_option('num_rows_table');
375374

376375
$sql_order = get_order_string();
@@ -398,7 +397,7 @@ function show_devices () {
398397
<?php print __('Search', 'flowview');?>
399398
</td>
400399
<td>
401-
<input type='text' id='filter' size='40' value='<?php print htmlspecialchars(get_request_var('filter'));?>'>
400+
<input type='text' id='filter' size='25' value='<?php print html_escape_request_var('filter');?>'>
402401
</td>
403402
<td>
404403
<input id='refresh' type='submit' value='<?php print __esc('Go', 'flowview');?>' title='<?php print __esc('Set/Refresh Filters', 'flowview');?>'>

flowview_schedules.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,9 @@ function show_schedules () {
368368
'default' => '1'
369369
),
370370
'filter' => array(
371-
'filter' => FILTER_CALLBACK,
371+
'filter' => FILTER_DEFAULT,
372372
'pageset' => true,
373-
'default' => '',
374-
'options' => array('options' => 'sanitize_search_string')
373+
'default' => ''
375374
),
376375
'sort_column' => array(
377376
'filter' => FILTER_CALLBACK,
@@ -405,7 +404,7 @@ function show_schedules () {
405404
<?php print __('Search', 'flowview');?>
406405
</td>
407406
<td>
408-
<input type='text' id='filter' size='25' value='<?php print htmlspecialchars(get_request_var('filter'));?>'>
407+
<input type='text' id='filter' size='25' value='<?php print html_escape_request_var('filter');?>'>
409408
</td>
410409
<td>
411410
<?php print __('Schedules', 'flowview');?>
@@ -465,7 +464,7 @@ function clearFilter() {
465464
html_end_box();
466465

467466
if (get_request_var('filter') != '') {
468-
$sql_where = "WHERE (name LIKE '%" . get_request_var_request('filter') . "%')";
467+
$sql_where = 'WHERE name LIKE ' . db_qstr('%' . get_request_var_request('filter') . '%');
469468
}else{
470469
$sql_where = '';
471470
}

0 commit comments

Comments
 (0)