diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2020-02-18 21:55:17 +0100 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2020-02-18 21:55:17 +0100 |
commit | a43b933df12f97c536a31d3d5a73ddda5f90ed94 (patch) | |
tree | dc99a1614a82930eca4687ca8a2f3328a9064e92 /src/Search | |
parent | 8d78d292036f5a1a95129fb3adb4b2d6d889f8cc (diff) | |
download | micropoly-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.php | 2 |
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); |