mirror of
https://github.com/processwire/processwire.git
synced 2025-08-17 12:10:45 +02:00
Fix issue with bitwise operators not properly return true on $database->isOperator() call
This commit is contained in:
@@ -648,14 +648,14 @@ class WireDatabasePDO extends Wire implements WireDatabase {
|
|||||||
public function isOperator($str, $bitwise = null) {
|
public function isOperator($str, $bitwise = null) {
|
||||||
|
|
||||||
$operators = array('=', '<', '>', '>=', '<=', '<>', '!=');
|
$operators = array('=', '<', '>', '>=', '<=', '<>', '!=');
|
||||||
$bitwise = array('&', '~', '&~', '|', '^', '<<', '>>');
|
$bitwiseOperators = array('&', '~', '&~', '|', '^', '<<', '>>');
|
||||||
$len = strlen($str);
|
$len = strlen($str);
|
||||||
|
|
||||||
if($len > 2 || $len < 1) return false;
|
if($len > 2 || $len < 1) return false;
|
||||||
|
|
||||||
if($bitwise === null) {
|
if($bitwise === null) {
|
||||||
// allow all operators
|
// allow all operators
|
||||||
$operators = array_merge($operators, $bitwise);
|
$operators = array_merge($operators, $bitwiseOperators);
|
||||||
} else if($bitwise === true) {
|
} else if($bitwise === true) {
|
||||||
// allow only bitwise operators
|
// allow only bitwise operators
|
||||||
$operators = $bitwise;
|
$operators = $bitwise;
|
||||||
|
Reference in New Issue
Block a user