Bugzilla – Attachment 154314 Details for
Bug 33406
Searching for authority with hyphen surrounded by spaces causes error 500 (with ES)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33406: Filter out some known isolated trouble makers
Bug-33406-Filter-out-some-known-isolated-trouble-m.patch (text/plain), 1.25 KB, created by
Pedro Amorim
on 2023-08-08 08:51:22 UTC
(
hide
)
Description:
Bug 33406: Filter out some known isolated trouble makers
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-08-08 08:51:22 UTC
Size:
1.25 KB
patch
obsolete
>From ba13c607412b02ff0f299057ddc87b09188125e0 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Tue, 8 Aug 2023 08:41:53 +0000 >Subject: [PATCH] Bug 33406: Filter out some known isolated trouble makers > >Test plan: >1) Launch k-t-d with ES: >-- ktd --es7 pull >-- ktd --es7 up >2) Visit /cgi-bin/koha/authorities/authorities-home.pl and search for 'tim' >3) Edit that, add a dash '-' to 100$a, like 'Bunce, Tim - name'" >4) Do a authority search for 'tim - name', notice it errors out >5) Apply patch >6) Perform the same search, notice it doesn't error and returns the correct record > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index e57d1d7b60..35ab4b7f91 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -1236,6 +1236,9 @@ sub _split_query { > # Filter out empty values > @tokens = grep( /\S/, @tokens ); > >+ # Filter out some known isolated trouble makers: -, ^, \, ~, + >+ @tokens = grep( !/^[-\^\\~\+]*$/, @tokens ); >+ > return @tokens; > } > >-- >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 33406
:
151067
|
154313
|
154314
|
155198
|
155199
|
155200
|
155611
|
155612
|
155613
|
155614
|
155818