Bugzilla – Attachment 137172 Details for
Bug 29418
Error searching for analytics in detail view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29418: Make clean_search_term escape double quotes
Bug-29418-Make-cleansearchterm-escape-double-quote.patch (text/plain), 1.39 KB, created by
Martin Renvoize (ashimema)
on 2022-07-05 13:50:53 UTC
(
hide
)
Description:
Bug 29418: Make clean_search_term escape double quotes
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-07-05 13:50:53 UTC
Size:
1.39 KB
patch
obsolete
>From d3a1e316b4556b0ade1cf04d76f3e98ca01fcf5c 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 29418: 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 29418
:
127325
|
127326
|
134865
|
134866
|
137023
|
137048
|
137135
|
137136
|
137137
|
137138
|
137139
|
137140
|
137142
|
137171
| 137172 |
137173
|
137174