From: Dennis Schafroth Date: Fri, 15 Jul 2011 13:47:55 +0000 (+0200) Subject: Encode special characters in term X-Git-Tag: v4.2.5~11 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=12ab7a040623d875c3e324e6a1df20652087b551 Encode special characters in term --- 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]);