From 302e24145891fdd2d6aee55004260205a22d6486 Mon Sep 17 00:00:00 2001 From: Brian White Date: Mon, 14 Oct 2013 19:14:33 -0400 Subject: [PATCH] Connection: fix nested OR when searching --- lib/Connection.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Connection.js b/lib/Connection.js index f4063e8..dd7a5e2 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -1689,7 +1689,10 @@ function buildSearchQuery(options, extensions, info, isOrChild) { if (criteria === 'OR') { if (args.length !== 2) throw new Error('OR must have exactly two arguments'); - searchargs += ' OR ('; + if (isOrChild) + searchargs += 'OR ('; + else + searchargs += ' OR ('; searchargs += buildSearchQuery(args[0], extensions, info, true); searchargs += ') ('; searchargs += buildSearchQuery(args[1], extensions, info, true);