From 2f73d16738aff9be0dee61a5da5d84779004e31a Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Tue, 1 Oct 2019 13:26:44 +0000 Subject: [PATCH] Fix - JS: Strip UTF8 new line separator from filter data - https://datatables.net/forums/discussion/comment/155263#Comment_155263 --- .datatables-commit-sync | 2 +- media/js/jquery.dataTables.js | 2 +- media/js/jquery.dataTables.min.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.datatables-commit-sync b/.datatables-commit-sync index 6b8413e7..d46ac1d4 100644 --- a/.datatables-commit-sync +++ b/.datatables-commit-sync @@ -1 +1 @@ -d9ae4709af4c9c898ea5ac05dfd852df9b291783 +12931741bafecd6a29dc92deb27d134b9d02decc diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 35e88060..528ea953 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -4530,7 +4530,7 @@ } if ( cellData.replace ) { - cellData = cellData.replace(/[\r\n]/g, ''); + cellData = cellData.replace(/[\r\n\u2028]/g, ''); } filterData.push( cellData ); diff --git a/media/js/jquery.dataTables.min.js b/media/js/jquery.dataTables.min.js index ddbfa0fe..90d2d440 100644 --- a/media/js/jquery.dataTables.min.js +++ b/media/js/jquery.dataTables.min.js @@ -56,8 +56,8 @@ c).val(f.sSearch).attr("placeholder",e.sSearchPlaceholder).on("keyup.DT search.D p?!b.bEscapeRegex:b.bRegex};La(b);if("ssp"!=E(b)){Cb(b,c.sSearch,d,h(c),c.bSmart,c.bCaseInsensitive);k(c);for(c=0;c=c.length)b.aiDisplay=h.slice();else{if(l||d||k.length>c.length||0!==c.indexOf(k)||b.bSorted)b.aiDisplay=h.slice();c=b.aiDisplay;for(d=0;d",{"class":b.oClasses.sInfo,id:d?null:c+"_info"});d||(b.aoDrawCallback.push({fn:Ib,sName:"information"}),e.attr("role","status").attr("aria-live","polite"),g(b.nTable).attr("aria-describedby",c+"_info"));return e[0]}function Ib(b){var c=b.aanFeatures.i;if(0!==c.length){var d=b.oLanguage,e=b._iDisplayStart+1,f=b.fnDisplayEnd(),k=b.fnRecordsTotal(),h=b.fnRecordsDisplay(),l=h?d.sInfo:d.sInfoEmpty;h!==k&&(l+=" "+d.sInfoFiltered);l+=d.sInfoPostFix;l=Jb(b,l);d=d.fnInfoCallback;null!==d&&(l=d.call(b.oInstance, +typeof n&&n.toString&&(n=n.toString())}else n="";n.indexOf&&-1!==n.indexOf("&")&&(za.innerHTML=n,n=ac?za.textContent:za.innerText);n.replace&&(n=n.replace(/[\r\n\u2028]/g,""));g.push(n)}l._aFilterData=g;l._sFilterRow=g.join(" ");k=!0}}return k}function Gb(b){return{search:b.sSearch,smart:b.bSmart,regex:b.bRegex,caseInsensitive:b.bCaseInsensitive}}function Hb(b){return{sSearch:b.search,bSmart:b.smart,bRegex:b.regex,bCaseInsensitive:b.caseInsensitive}}function yb(b){var c=b.sTableId,d=b.aanFeatures.i, +e=g("
",{"class":b.oClasses.sInfo,id:d?null:c+"_info"});d||(b.aoDrawCallback.push({fn:Ib,sName:"information"}),e.attr("role","status").attr("aria-live","polite"),g(b.nTable).attr("aria-describedby",c+"_info"));return e[0]}function Ib(b){var c=b.aanFeatures.i;if(0!==c.length){var d=b.oLanguage,e=b._iDisplayStart+1,f=b.fnDisplayEnd(),k=b.fnRecordsTotal(),h=b.fnRecordsDisplay(),l=h?d.sInfo:d.sInfoEmpty;h!==k&&(l+=" "+d.sInfoFiltered);l+=d.sInfoPostFix;l=Jb(b,l);d=d.fnInfoCallback;null!==d&&(l=d.call(b.oInstance, b,e,f,k,h,l));g(c).html(l)}}function Jb(b,c){var d=b.fnFormatNumber,e=b._iDisplayStart+1,f=b._iDisplayLength,k=b.fnRecordsDisplay(),h=-1===f;return c.replace(/_START_/g,d.call(b,e)).replace(/_END_/g,d.call(b,b.fnDisplayEnd())).replace(/_MAX_/g,d.call(b,b.fnRecordsTotal())).replace(/_TOTAL_/g,d.call(b,k)).replace(/_PAGE_/g,d.call(b,h?1:Math.ceil(e/f))).replace(/_PAGES_/g,d.call(b,h?1:Math.ceil(k/f)))}function ka(b){var c=b.iInitDisplayStart,d=b.aoColumns;var e=b.oFeatures;var f=b.bDeferLoading;if(b.bInitialised){tb(b); qb(b);ia(b,b.aoHeader);ia(b,b.aoFooter);L(b,!0);e.bAutoWidth&&Ka(b);var k=0;for(e=d.length;k",{name:d+"_length","aria-controls":d,"class":c.sLengthSelect});for(var h=0,l=k.length;h
").addClass(c.sLength);b.aanFeatures.l||(m[0].id=d+"_length");m.children().append(b.oLanguage.sLengthMenu.replace("_MENU_",