Bugzilla – Attachment 187634 Details for
Bug 40980
Clicking a search facet without logging in may trigger a cud-login error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40980: Only consider AND|OR|NOT/i operators
Bug-40980-Only-consider-ANDORNOTi-operators.patch (text/plain), 1.43 KB, created by
Pedro Amorim
on 2025-10-09 08:33:08 UTC
(
hide
)
Description:
Bug 40980: Only consider AND|OR|NOT/i operators
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-10-09 08:33:08 UTC
Size:
1.43 KB
patch
obsolete
>From 737318d28b3fa227a1b27c5f431917d760ba6731 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Thu, 9 Oct 2025 08:27:57 +0000 >Subject: [PATCH] Bug 40980: Only consider AND|OR|NOT/i operators > >Test plan, k-t-d with elastic search: >1) Make sure you're logged out >2) Access a search results page directly e.g.: >http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=music >3) You're prompted to login, login. >4) You're shown the search results directly, click a facet result (any facet) >5) You get a Error 403: >Programming error - op 'cud-login' must not start with 'cud-' for GET >6) Apply patch, restart plack, repeat >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 8ee830c6498..50c5425fa32 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -350,7 +350,7 @@ sub build_query_compat { > while ( my ( $oand, $otor, $index ) = $ea->() ) { > $query_cgi .= '&' if $query_cgi; > $query_cgi .= 'idx=' . uri_escape_utf8( $index // '' ) . '&q=' . uri_escape_utf8($oand); >- $query_cgi .= '&op=' . uri_escape_utf8($otor) if $otor; >+ $query_cgi .= '&op=' . uri_escape_utf8($otor) if $otor =~ /^(AND|OR|NOT)$/i; > } > $query_cgi .= '&scan=1' if ($scan); > >-- >2.39.5
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 40980
: 187634