1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-01-19 12:52:11 +01:00

Fix: If sType for a column is html and the data is null, then _fnDataToSearch could throw an error - 8987

This commit is contained in:
Allan Jardine 2012-03-14 07:51:07 +00:00
parent c22dfe00d3
commit b5f4938d7d
2 changed files with 8 additions and 8 deletions

View File

@ -2306,6 +2306,10 @@
{
return DataTable.ext.ofnSearch[sType]( sData );
}
else if ( sData === null )
{
return '';
}
else if ( sType == "html" )
{
return sData.replace(/[\r\n]/g," ").replace( /<.*?>/g, "" );
@ -2314,10 +2318,6 @@
{
return sData.replace(/[\r\n]/g," ");
}
else if ( sData === null )
{
return '';
}
return sData;
}

View File

@ -372,6 +372,10 @@ function _fnDataToSearch ( sData, sType )
{
return DataTable.ext.ofnSearch[sType]( sData );
}
else if ( sData === null )
{
return '';
}
else if ( sType == "html" )
{
return sData.replace(/[\r\n]/g," ").replace( /<.*?>/g, "" );
@ -380,10 +384,6 @@ function _fnDataToSearch ( sData, sType )
{
return sData.replace(/[\r\n]/g," ");
}
else if ( sData === null )
{
return '';
}
return sData;
}