Bugzilla – Attachment 137832 Details for
Bug 31106
Error searching for analytics in detail view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31106: Make clean_search_term escape double quotes
Bug-31106-Make-cleansearchterm-escape-double-quote.patch (text/plain), 1.39 KB, created by
Martin Renvoize (ashimema)
on 2022-07-18 16:55:48 UTC
(
hide
)
Description:
Bug 31106: Make clean_search_term escape double quotes
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-07-18 16:55:48 UTC
Size:
1.39 KB
patch
obsolete
>From 07934ad3879ed1c73f9640c775309d21558435f1 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 4 Jul 2022 15:19:27 -0300 >Subject: [PATCH] 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> >--- > Koha/SearchEngine/Zebra/QueryBuilder.pm | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/Koha/SearchEngine/Zebra/QueryBuilder.pm b/Koha/SearchEngine/Zebra/QueryBuilder.pm >index b0011d09a9..8b8d3473e7 100644 >--- a/Koha/SearchEngine/Zebra/QueryBuilder.pm >+++ b/Koha/SearchEngine/Zebra/QueryBuilder.pm >@@ -127,6 +127,8 @@ sub build_authorities_query_compat { > sub clean_search_term { > my ( $self, $term ) = @_; > >+ $term =~ s/"/\\"/g; >+ > return $term; > } > >-- >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 31106
:
137183
|
137184
|
137185
|
137237
|
137238
|
137239
|
137246
|
137247
|
137248
|
137831
| 137832 |
137833