From 80eb2ff3f196b1332e94fc0993c635584cfffe52 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Sun, 27 Oct 2019 07:24:17 -0400 Subject: [PATCH] Fix issue with bitwise operators not properly return true on $database->isOperator() call --- wire/core/WireDatabasePDO.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wire/core/WireDatabasePDO.php b/wire/core/WireDatabasePDO.php index 08e568ff..85f4d527 100644 --- a/wire/core/WireDatabasePDO.php +++ b/wire/core/WireDatabasePDO.php @@ -648,14 +648,14 @@ class WireDatabasePDO extends Wire implements WireDatabase { public function isOperator($str, $bitwise = null) { $operators = array('=', '<', '>', '>=', '<=', '<>', '!='); - $bitwise = array('&', '~', '&~', '|', '^', '<<', '>>'); + $bitwiseOperators = array('&', '~', '&~', '|', '^', '<<', '>>'); $len = strlen($str); if($len > 2 || $len < 1) return false; if($bitwise === null) { // allow all operators - $operators = array_merge($operators, $bitwise); + $operators = array_merge($operators, $bitwiseOperators); } else if($bitwise === true) { // allow only bitwise operators $operators = $bitwise;