From 58de38bd737d2dba617944b54a98d4bdb5810588 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 1 Aug 2024 19:44:58 +0200 Subject: Fix parentheses for complex `OR` boolean search expressions (#6672) * Fix OR parentheses * Pass all tests * Forgotten comment * Minor whitespace * Fix several cases envolving negation * Line length * Fix `OR NOT` --- app/Models/EntryDAO.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/Models/EntryDAO.php') diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index ec627dda1..ba0cf1970 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -762,7 +762,7 @@ SQL; if ($filterSearch !== '') { if ($search !== '') { $search .= $filter->operator(); - } elseif ($filter->operator() === 'AND NOT') { + } elseif (in_array($filter->operator(), ['AND NOT', 'OR NOT'], true)) { // Special case if we start with a negation (there is already the default AND before) $search .= ' NOT'; } -- cgit v1.2.3