]> git.koha-community.org Git - koha.git/commit
Bug 28316: screen unquoted semicolons and all followup colons
authorPetro Vashchuk <stalkernoid@gmail.com>
Fri, 18 Jun 2021 07:43:14 +0000 (10:43 +0300)
committerVictor Grousset/tuxayo <victor@tuxayo.net>
Wed, 22 Dec 2021 18:55:22 +0000 (19:55 +0100)
commit6ae9d2984631fca574aab022ae72d191a9cda1cb
treef6380300eb288412d8cdaf84953a282f133ac612
parent25024d8438d9f68a93f2fb644357fddb36babf9f
Bug 28316: screen unquoted semicolons and all followup colons

Currently searches like: "book:", ":book" and "host-item:test:n"
cause internal server errors.

This patch adds additional regexes that remove the colons at the start
and end of the query, and another regex that screens all follow-up
colons that go after the first colon to avoid errors when searching for
"host-item:test:n".

To reproduce:
1) using ES, search for the book with title that contains
semicolon at the start or at the end of the line, separated with spaces,
this should cause internal server error.
2) try doing the same with something like "host-item:test:n", it should
result in error as well.
3) apply the patch.
4) repeat steps 1-2, ensure that it works now.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 5b4b14e493fef9f8f84060b6b5d83fbdcccfc65e)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm