1
0
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:
Allan Jardine 2011-12-05 17:20:53 +00:00
parent 2928326042
commit 30e018f398
3 changed files with 8 additions and 8 deletions

View File

@ -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 );

View File

@ -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 );

View File

@ -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');
}