Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 1055d278878955d84d3f565fceb6d21f0c15b428 1 parent dc3f9b1
@DataTables authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  media/js/jquery.dataTables.js
  2. +1 −1  media/src/core/core.filter.js
View
2  media/js/jquery.dataTables.js
@@ -2342,7 +2342,7 @@
*/
function _fnEscapeRegex ( sVal )
{
- var acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^' ];
+ var acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^', '-' ];
var reReplace = new RegExp( '(\\' + acEscape.join('|\\') + ')', 'g' );
return sVal.replace(reReplace, '\\$1');
}
View
2  media/src/core/core.filter.js
@@ -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');
}
Please sign in to comment.
Something went wrong with that request. Please try again.