Bugzilla – Attachment 140597 Details for
Bug 30982
Use the REST API for background job list view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30982: (follow-up) Only escape asterisk chars when non-exact search
Bug-30982-follow-up-Only-escape-asterisk-chars-whe.patch (text/plain), 2.14 KB, created by
Martin Renvoize (ashimema)
on 2022-09-13 14:57:34 UTC
(
hide
)
Description:
Bug 30982: (follow-up) Only escape asterisk chars when non-exact search
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-09-13 14:57:34 UTC
Size:
2.14 KB
patch
obsolete
>From 8543791d05622e10eea3954b56d0c2c3ef7762eb Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 12 Sep 2022 14:53:40 -0300 >Subject: [PATCH] Bug 30982: (follow-up) Only escape asterisk chars when > non-exact search > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index f6b079c794..d33168bb32 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -578,9 +578,6 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { > > function build_query(col, value){ > >- // escape SQL special characters >- value = value.replace(/(\%|\_|\\)/g, "\\$1" ); >- > var parts = []; > var attributes = col.data.split(':'); > for (var i=0;i<attributes.length;i++){ >@@ -591,6 +588,10 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { > value = value.replace(/^\^/, '').replace(/\$$/, ''); > criteria = "exact"; > } >+ else { >+ // escape SQL special characters when search is not exact >+ value = value.replace(/(\%|\_|\\)/g, "\\$1" ); >+ } > part[!attr.includes('.')?'me.'+attr:attr] = criteria === 'exact' > ? value > : {like: (['contains', 'ends_with'].indexOf(criteria) !== -1?'%':'') + value + (['contains', 'starts_with'].indexOf(criteria) !== -1?'%':'')}; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30982
:
136245
|
136246
|
136670
|
136671
|
136672
|
136707
|
136708
|
136715
|
138114
|
139636
|
139637
|
139638
|
139639
|
139640
|
139641
|
140488
|
140489
|
140490
|
140491
|
140492
|
140493
|
140494
|
140495
|
140496
|
140497
|
140498
|
140589
|
140590
|
140591
|
140592
|
140593
|
140594
|
140595
|
140596
|
140597
|
140598
|
140599
|
140789
|
140884
|
140885
|
140886
|
140887
|
140888
|
140889
|
140890
|
140891
|
140892
|
140893
|
140894
|
140895
|
140896
|
140897
|
142859