From a43b933df12f97c536a31d3d5a73ddda5f90ed94 Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Tue, 18 Feb 2020 21:55:17 +0100 Subject: LogicOp: Fix assert() trying to eval its parameter Apparently I managed to turn off assertions in my dev setup m(. Passing in a string (which happens in the expected path here) tries to evaluate it, which then fails. We fix this by asserting an isset() instead. --- src/Search/LogicOp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Search/LogicOp.php b/src/Search/LogicOp.php index 85fb8fa..19d85f3 100644 --- a/src/Search/LogicOp.php +++ b/src/Search/LogicOp.php @@ -62,8 +62,8 @@ class LogicOp implements SearchExpr $a = $this->a->toSQL("a_$bindPrefix", $singleFTS); $b = $this->b->toSQL("b_$bindPrefix", $singleFTS); + assert(isset(self::SQLOPS[$this->op])); $sqlop = self::SQLOPS[$this->op]; - assert($sqlop); $sqlex->sql = "(({$a->sql}) {$sqlop} ({$b->sql}))"; $sqlex->bindings = array_merge($a->bindings, $b->bindings); -- cgit v1.2.3-70-g09d2