aboutsummaryrefslogtreecommitdiff
path: root/src/Search
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2020-02-18 21:55:17 +0100
committerLaria Carolin Chabowski <laria@laria.me>2020-02-18 21:55:17 +0100
commita43b933df12f97c536a31d3d5a73ddda5f90ed94 (patch)
treedc99a1614a82930eca4687ca8a2f3328a9064e92 /src/Search
parent8d78d292036f5a1a95129fb3adb4b2d6d889f8cc (diff)
downloadmicropoly-a43b933df12f97c536a31d3d5a73ddda5f90ed94.tar.gz
micropoly-a43b933df12f97c536a31d3d5a73ddda5f90ed94.tar.bz2
micropoly-a43b933df12f97c536a31d3d5a73ddda5f90ed94.zip
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.
Diffstat (limited to 'src/Search')
-rw-r--r--src/Search/LogicOp.php2
1 files changed, 1 insertions, 1 deletions
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);