@@ -, +, @@ - 'Cordoba %' - 'Buenos Aires _' - 'London \' --- koha-tmpl/intranet-tmpl/prog/js/datatables.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ a/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -578,8 +578,8 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { function build_query(col, value){ - // escape SQL special characters - value = value.replace(/(\%|\_|\\)/g, "\\$1" ); + // escape SQL special character \ + value = value.replace(/(\\)/g, "\\$1" ); var parts = []; var attributes = col.data.split(':'); @@ -590,6 +590,9 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { if ( value.match(/^\^(.*)\$$/) ) { value = value.replace(/^\^/, '').replace(/\$$/, ''); criteria = "exact"; + } else { + // escape SQL LIKE special characters % and _ + value = value.replace(/(\%|\_)/g, "\\$1"); } part[!attr.includes('.')?'me.'+attr:attr] = criteria === 'exact' ? value --