]> git.koha-community.org Git - koha.git/commit
Bug 31106: Make clean_search_term escape double quotes
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 4 Jul 2022 18:19:27 +0000 (15:19 -0300)
committerArthur Suzuki <arthur.suzuki@biblibre.com>
Tue, 16 Aug 2022 08:46:01 +0000 (10:46 +0200)
commit1e4ca489310ce90456ffdff211c172eb0819afc8
treed396e548407343fd9c4e4cc351212367f73886e9
parent702aefa6ecac04c4e58c7766f407e46f3812f8b9
Bug 31106: Make clean_search_term escape double quotes

We noticed that several characters will break Zebra queries. So search
terms need to be quoted for things to work. In this context, double
quotes inside search terms are problematic because double quotes are
what we use for quoting strings.

This patch makes the clean_search_term method escape double quotes.

To test:
1. Apply the unit tests patch
2. Run:
   $ kshell
  k$ prove t/Koha/SearchEngine/Zebra/QueryBuilder.t
=> FAIL: It doesn't work as it should!
3. Apply this patch
4. Repeat 2
=> SUCCESS: It does the job!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 24bb15785dd7f176c1ffe2bf8ae5e8a05cc0707a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2e063b708d29095de6462f063ae4d092f22c386f)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Koha/SearchEngine/Zebra/QueryBuilder.pm