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-12 12:20:39 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-08-12 12:20:39 +0400
commit69a06eeb29311a16e1dfef311293bb9ed34ad53d (patch)
treea7a09b0e266d1cb7244695b1d839d04e6f2a4a48 /plugins
parent1bac9482519205918beaaf67f4496638da2a1952 (diff)
refs #5949 only escape a quantifier in case it is the first character
Diffstat (limited to 'plugins')
-rw-r--r--plugins/CoreHome/javascripts/dataTable.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js
index 926f1b26ca..16868d3f98 100644
--- a/plugins/CoreHome/javascripts/dataTable.js
+++ b/plugins/CoreHome/javascripts/dataTable.js
@@ -601,7 +601,9 @@ $.extend(DataTable.prototype, UIControl.prototype, {
var patternsToReplace = [{from: '?', to: '\\?'}, {from: '+', to: '\\+'}, {from: '*', to: '\\*'}]
$.each(patternsToReplace, function (index, pattern) {
- currentPattern = currentPattern.replace(pattern.to, pattern.from);
+ if (0 === currentPattern.indexOf(pattern.to)) {
+ currentPattern = pattern.from + currentPattern.substr(2);
+ }
});
$('.dataTableSearchPattern', domElem)
@@ -625,7 +627,9 @@ $.extend(DataTable.prototype, UIControl.prototype, {
self.param.filter_offset = 0;
$.each(patternsToReplace, function (index, pattern) {
- keyword = keyword.replace(pattern.from, pattern.to);
+ if (0 === keyword.indexOf(pattern.from)) {
+ keyword = pattern.to + keyword.substr(1);
+ }
});
if (self.param.search_recursive) {