Bugzilla – Attachment 137184 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.28 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-07-05 19:02:18 UTC
(
hide
)
Description:
Bug 31106: Make clean_search_term escape double quotes
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-07-05 19:02:18 UTC
Size:
1.28 KB
patch
obsolete
>From 679ba9149fc4894ad435e5278f0c5243f7d68e21 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> >--- > 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.30.2
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