Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@googlemail.com>2014-08-11 13:21:55 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-08-11 13:21:55 +0400
commit99bad12164d337cf1d89eea7c7149330b9ab5a64 (patch)
treea7aea24b61e438b966cc520c719eaf1768ca73b0 /plugins
parenta8830625aafabb479486cbdf5f6dfe5215bfed9d (diff)
refs #5949 prevent warning if a quantifier is used. Escape them to make sure they are not applied in filter
Diffstat (limited to 'plugins')
-rw-r--r--plugins/CoreHome/javascripts/dataTable.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js
index 08fe3224e3..926f1b26ca 100644
--- a/plugins/CoreHome/javascripts/dataTable.js
+++ b/plugins/CoreHome/javascripts/dataTable.js
@@ -598,6 +598,12 @@ $.extend(DataTable.prototype, UIControl.prototype, {
}
currentPattern = piwikHelper.htmlDecode(currentPattern);
+ var patternsToReplace = [{from: '?', to: '\\?'}, {from: '+', to: '\\+'}, {from: '*', to: '\\*'}]
+
+ $.each(patternsToReplace, function (index, pattern) {
+ currentPattern = currentPattern.replace(pattern.to, pattern.from);
+ });
+
$('.dataTableSearchPattern', domElem)
.css({display: 'block'})
.each(function () {
@@ -618,6 +624,10 @@ $.extend(DataTable.prototype, UIControl.prototype, {
var keyword = $(this).siblings('.searchInput').val();
self.param.filter_offset = 0;
+ $.each(patternsToReplace, function (index, pattern) {
+ keyword = keyword.replace(pattern.from, pattern.to);
+ });
+
if (self.param.search_recursive) {
self.param.filter_column_recursive = 'label';
self.param.filter_pattern_recursive = keyword;