Skip to content

Commit 634911f

Browse files
committed
additional security against AST changes
1 parent 36c76ee commit 634911f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cql.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fn generate_cql(ast: ast::Ast) -> Result<String, FocusError> {
7070

7171
cql = cql.replace("{{lists}}", lists.as_str());
7272

73-
if retrieval_criteria.is_empty() || retrieval_criteria=="()" {
73+
if retrieval_criteria.is_empty() || retrieval_criteria.replace("(","").replace(")", "").replace(" ", "") == "" { //to deal with an empty criteria tree of an arbitrary depth
7474
cql = cql.replace("{{retrieval_criteria}}", "true"); //()?
7575
} else {
7676
let formatted_retrieval_criteria = format!("({})", retrieval_criteria);

0 commit comments

Comments
 (0)