mirror of
https://github.com/DataTables/DataTables.git
synced 2024-12-01 13:24:10 +01:00
Fix: Cast fnFilter input to a string always - since we are always going to treat it as a string
This commit is contained in:
parent
2928326042
commit
30e018f398
8
media/js/jquery.dataTables.js
vendored
8
media/js/jquery.dataTables.js
vendored
@ -2263,8 +2263,8 @@
|
||||
function _fnEscapeRegex ( sVal )
|
||||
{
|
||||
var acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^' ];
|
||||
var reReplace = new RegExp( '(\\' + acEscape.join('|\\') + ')', 'g' );
|
||||
return sVal.replace(reReplace, '\\$1');
|
||||
var reReplace = new RegExp( '(\\' + acEscape.join('|\\') + ')', 'g' );
|
||||
return sVal.replace(reReplace, '\\$1');
|
||||
}
|
||||
|
||||
|
||||
@ -5056,7 +5056,7 @@
|
||||
{
|
||||
/* Global filter */
|
||||
_fnFilterComplete( oSettings, {
|
||||
"sSearch":sInput,
|
||||
"sSearch":sInput+"",
|
||||
"bRegex": bRegex,
|
||||
"bSmart": bSmart
|
||||
}, 1 );
|
||||
@ -5073,7 +5073,7 @@
|
||||
else
|
||||
{
|
||||
/* Single column filter */
|
||||
oSettings.aoPreSearchCols[ iColumn ].sSearch = sInput;
|
||||
oSettings.aoPreSearchCols[ iColumn ].sSearch = sInput+"";
|
||||
oSettings.aoPreSearchCols[ iColumn ].bRegex = bRegex;
|
||||
oSettings.aoPreSearchCols[ iColumn ].bSmart = bSmart;
|
||||
_fnFilterComplete( oSettings, oSettings.oPreviousSearch, 1 );
|
||||
|
@ -472,7 +472,7 @@ this.fnFilter = function( sInput, iColumn, bRegex, bSmart, bShowGlobal )
|
||||
{
|
||||
/* Global filter */
|
||||
_fnFilterComplete( oSettings, {
|
||||
"sSearch":sInput,
|
||||
"sSearch":sInput+"",
|
||||
"bRegex": bRegex,
|
||||
"bSmart": bSmart
|
||||
}, 1 );
|
||||
@ -489,7 +489,7 @@ this.fnFilter = function( sInput, iColumn, bRegex, bSmart, bShowGlobal )
|
||||
else
|
||||
{
|
||||
/* Single column filter */
|
||||
oSettings.aoPreSearchCols[ iColumn ].sSearch = sInput;
|
||||
oSettings.aoPreSearchCols[ iColumn ].sSearch = sInput+"";
|
||||
oSettings.aoPreSearchCols[ iColumn ].bRegex = bRegex;
|
||||
oSettings.aoPreSearchCols[ iColumn ].bSmart = bSmart;
|
||||
_fnFilterComplete( oSettings, oSettings.oPreviousSearch, 1 );
|
||||
|
@ -368,7 +368,7 @@ function _fnDataToSearch ( sData, sType )
|
||||
function _fnEscapeRegex ( sVal )
|
||||
{
|
||||
var acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^' ];
|
||||
var reReplace = new RegExp( '(\\' + acEscape.join('|\\') + ')', 'g' );
|
||||
return sVal.replace(reReplace, '\\$1');
|
||||
var reReplace = new RegExp( '(\\' + acEscape.join('|\\') + ')', 'g' );
|
||||
return sVal.replace(reReplace, '\\$1');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user