Bug 31106: 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> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> (cherry picked from commit24bb15785d) Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> (cherry picked from commit2e063b708d) Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
This commit is contained in:
parent
702aefa6ec
commit
1e4ca48931
|
|
@ -127,6 +127,8 @@ sub build_authorities_query_compat {
|
|||
sub clean_search_term {
|
||||
my ( $self, $term ) = @_;
|
||||
|
||||
$term =~ s/"/\\"/g;
|
||||
|
||||
return $term;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue