From 12ab7a040623d875c3e324e6a1df20652087b551 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Fri, 15 Jul 2011 15:47:55 +0200 Subject: [PATCH] Encode special characters in term --- src/rpn2solr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpn2solr.c b/src/rpn2solr.c index 11abe87..70b2f6c 100644 --- a/src/rpn2solr.c +++ b/src/rpn2solr.c @@ -254,9 +254,9 @@ static int rpn2solr_simple(solr_transform_t ct, /* Bug 2878: Check and add Truncation */ if (checkForLeftTruncation(apt->attributes)) wrbuf_puts(w, "*"); - /* BUG 4415: Escape : (as \:) in string terms */ for (i = 0 ; i < lterm; i++) { - if (sterm[i] == ':') { + /* BUG 4415: Escape special characters in string terms */ + if (strchr("+-&|!(){}[]^\"~*?:\\", sterm[i])) { wrbuf_putc(w, '\\'); } wrbuf_putc(w, sterm[i]); -- 1.7.10.4