Permalink
Browse files

Fix: Regex filter escaping wasn't escaping the dash ('-') character b…

…elieve it or not. That's been there since very early DataTables!
  • Loading branch information...
DataTables committed Jun 13, 2012
1 parent dc3f9b1 commit 1055d278878955d84d3f565fceb6d21f0c15b428
Showing with 2 additions and 2 deletions.
  1. +1 −1 media/js/jquery.dataTables.js
  2. +1 −1 media/src/core/core.filter.js
@@ -2342,7 +2342,7 @@
*/
function _fnEscapeRegex ( sVal )
{
- var acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^' ];
+ var acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^', '-' ];
var reReplace = new RegExp( '(\\' + acEscape.join('|\\') + ')', 'g' );
return sVal.replace(reReplace, '\\$1');
}
@@ -398,7 +398,7 @@ function _fnDataToSearch ( sData, sType )
*/
function _fnEscapeRegex ( sVal )
{
- var acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^' ];
+ var acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^', '-' ];
var reReplace = new RegExp( '(\\' + acEscape.join('|\\') + ')', 'g' );
return sVal.replace(reReplace, '\\$1');
}

0 comments on commit 1055d27

Please sign in to comment.