]> 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>
Sun, 30 Jan 2022 23:44:32 +0000 (00:44 +0100)
commit368fedd5c177795397ef49abdc404a7adb43a0da
tree966dcb9f5f1e748ae53a204c7850c51cd82641a7
parentec6b3f709195decfd7d73ad3aab120d0d9b68fdb
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