Bug 31565: Escape datatables MySQL special characters only in LIKE queries
authorLari Taskula <lari.taskula@hypernova.fi>
Fri, 16 Sep 2022 14:05:15 +0000 (14:05 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 19 Sep 2022 18:03:12 +0000 (15:03 -0300)
commit45d19c6c77031c2ca62234ad190066fed3fa48f0
tree88be0bde57e126b1427eb9682062c3c0b5c97565
parent41d0daaff8ac04d58fd44f3a35c4c7be2197a9fe
Bug 31565: Escape datatables MySQL special characters only in LIKE queries

Escaping \ yields no results when performing exact search in datatables.
This patch adds MySQL special character escaping only to LIKE searches.

To test:
1. Add following categorycode 'TEST\CAT' by SQL
insert into categories (categorycode,description) values ('TEST\\CAT', 'TEST\\CAT');
2. Add a patron into TEST\CAT category
3. Go to patron search
4. Limit search by category TEST\CAT
5. Observe no results
6. Apply patch
7. Refresh patron search page
8. Limit search by category TEST\CAT
9. Observe Koha redirecting you to patron you chose in step 2

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/js/datatables.js