From b5f4938d7d59c0372f48699223afa266db49075b Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Wed, 14 Mar 2012 07:51:07 +0000 Subject: [PATCH] Fix: If sType for a column is html and the data is null, then _fnDataToSearch could throw an error - 8987 --- media/js/jquery.dataTables.js | 8 ++++---- media/src/core/core.filter.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 0edc4080..3b4bde20 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -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; } diff --git a/media/src/core/core.filter.js b/media/src/core/core.filter.js index 4cd1436b..6237d278 100644 --- a/media/src/core/core.filter.js +++ b/media/src/core/core.filter.js @@ -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; }