From bb260f02e0de549f0ac2327b1d7b4f4a236a9a2a Mon Sep 17 00:00:00 2001 From: brunoais Date: Sat, 24 Oct 2015 14:36:41 +0100 Subject: [PATCH] [feature/sql-bool-builder] Changing syntax Changing the syntax used to the one Nicofuma suggested. PHPBB3-13652 --- phpBB/phpbb/db/driver/driver.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index 7e2d7a5ea6..410dd17b32 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -812,16 +812,16 @@ abstract class driver implements driver_interface if ($operations_ary[0] !== 'AND' && $operations_ary[0] !== 'OR') { - $operations_ary = array('AND', $operations_ary); + $operations_ary = array('AND', array($operations_ary)); } return $this->_process_boolean_tree($operations_ary) . "\n"; } protected function _process_boolean_tree($operations_ary) { - $operation = array_shift($operations_ary); + $operation = $operations_ary[0]; - foreach ($operations_ary as &$condition) + foreach ($operations_ary[1] as &$condition) { switch ($condition[0]) { @@ -917,11 +917,11 @@ abstract class driver implements driver_interface if ($operation === 'NOT') { - $operations_ary = implode("", $operations_ary); + $operations_ary = implode("", $operations_ary[1]); } else { - $operations_ary = implode(" \n $operation ", $operations_ary); + $operations_ary = implode(" \n $operation ", $operations_ary[1]); } return $operations_ary;