From 4acd8e9b95670be2c6a4f46029b2049690e7f9e7 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 5 Mar 2014 15:29:57 +0000 Subject: [PATCH] 2014-03-05 Miguel de Dios * index.php, operation/search_results.php: fixed the global search when the text to search end with whitespace. Incident: #605 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9510 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++++++ pandora_console/index.php | 2 +- pandora_console/operation/search_results.php | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 84506ab276..caf42e1a0f 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2014-03-05 Miguel de Dios + + * index.php, operation/search_results.php: fixed the global search + when the text to search end with whitespace. + + Incident: #605 + 2014-03-05 Miguel de Dios * include/ajax/module.php: fixed the ajax calls for to get json diff --git a/pandora_console/index.php b/pandora_console/index.php index bfee18a0bd..4deca0da52 100644 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -158,7 +158,7 @@ if ($change_pass == 1) { $searchPage = false; $search = get_parameter_get("head_search_keywords"); if (strlen($search) > 0) { - $config['search_keywords'] = trim(get_parameter('keywords')); + $config['search_keywords'] = io_safe_input(trim(io_safe_output(get_parameter('keywords')))); // If not search category providad, we'll use an agent search $config['search_category'] = get_parameter('search_category', 'all'); if (($config['search_keywords'] != 'Enter keywords to search') && (strlen($config['search_keywords']) > 0)) diff --git a/pandora_console/operation/search_results.php b/pandora_console/operation/search_results.php index 697a25b9f3..5a4b8d44db 100644 --- a/pandora_console/operation/search_results.php +++ b/pandora_console/operation/search_results.php @@ -26,8 +26,9 @@ $searchMaps = $searchReports = $searchGraphs = check_acl($config["id_user"], 0, $searchMain = true; $arrayKeywords = explode(' ', $config['search_keywords']); + $temp = array(); -foreach ($arrayKeywords as $keyword){ +foreach ($arrayKeywords as $keyword) { // Remember, $keyword is already pass a safeinput filter. array_push($temp, "%" . $keyword . "%"); }