From 2276c1c0f246a39dee8d0e979c89e8de0ee7a5de Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sun, 22 Jun 2014 18:08:38 +0200 Subject: [ticket/12387] Cleanup *_free_result call and remove @ on that call PHPBB3-12387 --- phpBB/phpbb/db/driver/driver.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb/db/driver/driver.php') diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index 3d4aa95606..3c23f8fa36 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -175,7 +175,7 @@ abstract class driver implements driver_interface $query_id = $this->query_result; } - if ($query_id !== false) + if ($query_id) { $result = array(); while ($row = $this->sql_fetchrow($query_id)) @@ -206,7 +206,7 @@ abstract class driver implements driver_interface return $cache->sql_rowseek($rownum, $query_id); } - if ($query_id === false) + if (!$query_id) { return false; } @@ -214,7 +214,7 @@ abstract class driver implements driver_interface $this->sql_freeresult($query_id); $query_id = $this->sql_query($this->last_query_text); - if ($query_id === false) + if (!$query_id) { return false; } @@ -243,7 +243,7 @@ abstract class driver implements driver_interface $query_id = $this->query_result; } - if ($query_id !== false) + if ($query_id) { if ($rownum !== false) { -- cgit v1.2.1 From a2300eb3aa428a080314caf0c0b60556f6701ffa Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 20 Nov 2013 14:04:06 +0100 Subject: [feature/patchwork-utf8] Remove utf8_str_replace --- phpBB/phpbb/db/driver/driver.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb/db/driver/driver.php') diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index 4be315a154..8d360fc3e2 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -363,8 +363,8 @@ abstract class driver implements driver_interface */ function sql_like_expression($expression) { - $expression = utf8_str_replace(array('_', '%'), array("\_", "\%"), $expression); - $expression = utf8_str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression); + $expression = str_replace(array('_', '%'), array("\_", "\%"), $expression); + $expression = str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression); return $this->_sql_like_expression('LIKE \'' . $this->sql_escape($expression) . '\''); } @@ -374,8 +374,8 @@ abstract class driver implements driver_interface */ function sql_not_like_expression($expression) { - $expression = utf8_str_replace(array('_', '%'), array("\_", "\%"), $expression); - $expression = utf8_str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression); + $expression = str_replace(array('_', '%'), array("\_", "\%"), $expression); + $expression = str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression); return $this->_sql_not_like_expression('NOT LIKE \'' . $this->sql_escape($expression) . '\''); } -- cgit v1.2.1 From 5c77e4381945300ba9a1086b99fac12ae48c52a8 Mon Sep 17 00:00:00 2001 From: brunoais Date: Tue, 24 Feb 2015 23:03:11 +0000 Subject: [feature/sql-bool-builder] First working version PHPBB3-13652 --- phpBB/phpbb/db/driver/driver.php | 92 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) (limited to 'phpBB/phpbb/db/driver/driver.php') diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index 8d360fc3e2..5822adceab 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -792,6 +792,98 @@ abstract class driver implements driver_interface return $sql; } + + + protected function _process_boolean_tree_first($operations_ary) + { + if ($operations_ary[0] !== 'AND' && + $operations_ary[0] !== 'OR') + { + $operations_ary = array('AND', $operations_ary); + } + return $this->_process_boolean_tree($operations_ary) . "\n"; + } + + protected function _process_boolean_tree($operations_ary) + { + $operation = array_shift($operations_ary); + + foreach ($operations_ary AS &$condition) + { + switch ($condition[0]) + { + case 'AND': + case 'OR': + + $condition = ' ( ' . $this->_process_boolean_tree($condition) . ') '; + + break; + case 'NOT': + + $condition = ' NOT ' . $this->_process_boolean_tree($condition); + + break; + + default: + + switch (sizeof($condition)) + { + case 3: + + // Typical 3 element clause with {left hand} {operator} {right hand} + switch ($condition[1]) + { + case 'IN': + case 'NOT_IN': + + // As this is used with an IN, assume it is a set of elements for sql_in_set() + $condition = $this->sql_in_set($condition[0], $condition[2], $condition[1] === 'NOT_IN', true); + + break; + + default: + + $condition = implode(' ', $condition); + + break; + } + + break; + + case 5: + + // Subquery with {left hand} {operator} {compare kind} {SELECT Kind } {Sub Query} + + $condition = $condition[0] . ' ' . $condition[1] . ' ' . $condition[2] . ' ( '; + $condition .= $this->sql_build_query($condition[3], $condition[4]); + $condition .= ' )'; + + break; + + default: + // This is an unpredicted clause setup. Just join all elements. + $condition = implode(' ', $condition); + + break; + } + + break; + } + + } + + if($operation === 'NOT') + { + $operations_ary = implode("", $operations_ary); + } + else + { + $operations_ary = implode(" \n $operation ", $operations_ary); + } + + return $operations_ary; + } + /** * {@inheritDoc} -- cgit v1.2.1 From b54adaaabed7546254ff8317763214cce3a40237 Mon Sep 17 00:00:00 2001 From: brunoais Date: Wed, 25 Feb 2015 07:54:31 +0000 Subject: [feature/sql-bool-builder] Removed non-necessary spaces PHPBB3-13652 --- phpBB/phpbb/db/driver/driver.php | 58 ++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'phpBB/phpbb/db/driver/driver.php') diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index 5822adceab..cdff6bf9de 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -792,11 +792,11 @@ abstract class driver implements driver_interface return $sql; } - - + + protected function _process_boolean_tree_first($operations_ary) { - if ($operations_ary[0] !== 'AND' && + if ($operations_ary[0] !== 'AND' && $operations_ary[0] !== 'OR') { $operations_ary = array('AND', $operations_ary); @@ -807,71 +807,71 @@ abstract class driver implements driver_interface protected function _process_boolean_tree($operations_ary) { $operation = array_shift($operations_ary); - + foreach ($operations_ary AS &$condition) { switch ($condition[0]) { case 'AND': case 'OR': - + $condition = ' ( ' . $this->_process_boolean_tree($condition) . ') '; - + break; case 'NOT': - + $condition = ' NOT ' . $this->_process_boolean_tree($condition); - + break; - + default: - + switch (sizeof($condition)) { case 3: - + // Typical 3 element clause with {left hand} {operator} {right hand} switch ($condition[1]) - { + { case 'IN': case 'NOT_IN': - + // As this is used with an IN, assume it is a set of elements for sql_in_set() $condition = $this->sql_in_set($condition[0], $condition[2], $condition[1] === 'NOT_IN', true); - + break; - + default: - + $condition = implode(' ', $condition); - + break; } - + break; - + case 5: - + // Subquery with {left hand} {operator} {compare kind} {SELECT Kind } {Sub Query} - + $condition = $condition[0] . ' ' . $condition[1] . ' ' . $condition[2] . ' ( '; $condition .= $this->sql_build_query($condition[3], $condition[4]); $condition .= ' )'; - + break; - + default: // This is an unpredicted clause setup. Just join all elements. $condition = implode(' ', $condition); - + break; } - + break; } - + } - + if($operation === 'NOT') { $operations_ary = implode("", $operations_ary); @@ -880,10 +880,10 @@ abstract class driver implements driver_interface { $operations_ary = implode(" \n $operation ", $operations_ary); } - + return $operations_ary; } - + /** * {@inheritDoc} -- cgit v1.2.1 From 46de94690453e0bd6dfc589682b7c4ede34f1d59 Mon Sep 17 00:00:00 2001 From: brunoais Date: Wed, 25 Feb 2015 07:55:24 +0000 Subject: [feature/sql-bool-builder] Added code to use this feature for the WHERE clause PHPBB3-13652 --- phpBB/phpbb/db/driver/driver.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/driver/driver.php') diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index cdff6bf9de..0fbbe5ae7c 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -774,7 +774,18 @@ abstract class driver implements driver_interface if (!empty($array['WHERE'])) { - $sql .= ' WHERE ' . $this->_sql_custom_build('WHERE', $array['WHERE']); + $sql .= ' WHERE '; + + if (is_array($array['WHERE'])) + { + $sql_where = $this->_process_boolean_tree_first($array['WHERE']); + } + else + { + $sql_where = $array['WHERE']; + } + + $sql .= $this->_sql_custom_build('WHERE', $sql_where); } if (!empty($array['GROUP_BY'])) -- cgit v1.2.1 From 5c1850e10e0e31e4f72cc16c657e37bb009659df Mon Sep 17 00:00:00 2001 From: brunoais Date: Wed, 25 Feb 2015 09:09:48 +0000 Subject: [feature/sql-bool-builder] AS keyword must be lowercase; AS keyword must be lowercase; expected "as" but found "AS" PHPBB3-13652 --- phpBB/phpbb/db/driver/driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/driver/driver.php') diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index 0fbbe5ae7c..f66f10322b 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -819,7 +819,7 @@ abstract class driver implements driver_interface { $operation = array_shift($operations_ary); - foreach ($operations_ary AS &$condition) + foreach ($operations_ary as &$condition) { switch ($condition[0]) { -- cgit v1.2.1 From 51737be6162584209b483f97daa87ce9d3c039b0 Mon Sep 17 00:00:00 2001 From: brunoais Date: Sat, 28 Feb 2015 18:14:00 +0000 Subject: [feature/sql-bool-builder] Also use parenthesis for the NOT operator Be on the safe side, also use parenthesis for the NOT operator PHPBB3-13652 --- phpBB/phpbb/db/driver/driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/driver/driver.php') diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index f66f10322b..d2bb5f4f7c 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -831,7 +831,7 @@ abstract class driver implements driver_interface break; case 'NOT': - $condition = ' NOT ' . $this->_process_boolean_tree($condition); + $condition = ' NOT (' . $this->_process_boolean_tree($condition) . ') '; break; -- cgit v1.2.1 From 5d70f612be113336d6a85146369232c87d1b069b Mon Sep 17 00:00:00 2001 From: brunoais Date: Sun, 1 Mar 2015 11:39:20 +0000 Subject: [feature/sql-bool-builder] Explain better the code in the first Explain what that if and check is for in the first method that is called. PHPBB3-13652 --- phpBB/phpbb/db/driver/driver.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'phpBB/phpbb/db/driver/driver.php') diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index d2bb5f4f7c..cda2f7f86d 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -807,6 +807,8 @@ abstract class driver implements driver_interface protected function _process_boolean_tree_first($operations_ary) { + // In cases where an array exists but there is no head condition, + // it should be because there's only 1 WHERE clause. This seems the best way to deal with it. if ($operations_ary[0] !== 'AND' && $operations_ary[0] !== 'OR') { -- cgit v1.2.1 From 298d86009ed77a4b75792a6237f987be271ac43c Mon Sep 17 00:00:00 2001 From: brunoais Date: Sun, 15 Mar 2015 11:40:02 +0000 Subject: [feature/sql-bool-builder] Added LIKE and NOT_LIKE to the comparations PHPBB3-13652 --- phpBB/phpbb/db/driver/driver.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'phpBB/phpbb/db/driver/driver.php') diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index cda2f7f86d..ce69ef6a52 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -854,6 +854,18 @@ abstract class driver implements driver_interface break; + case 'LIKE': + + $condition = $condition[0] . ' ' . $this->sql_like_expression($condition[2]) . ' '; + + break; + + case 'NOT_LIKE': + + $condition = $condition[0] . ' ' . $this->sql_not_like_expression($condition[2]) . ' '; + + break; + default: $condition = implode(' ', $condition); -- cgit v1.2.1 From 576eaa0cff7a5e051aa672034e596e90f65fc1a9 Mon Sep 17 00:00:00 2001 From: brunoais Date: Mon, 16 Mar 2015 11:31:51 +0000 Subject: [feature/sql-bool-builder] Adding the IS operator to predicted operators PHPBB3-13652 --- phpBB/phpbb/db/driver/driver.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'phpBB/phpbb/db/driver/driver.php') diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index ce69ef6a52..4d78c84c8a 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -866,6 +866,24 @@ abstract class driver implements driver_interface break; + case 'IS_NOT': + + $condition[1] = 'IS NOT'; + + // no break + case 'IS': + + // If the value is NULL, the string of it is the empty string ('') which is not the intended result. + // this should solve that + if ($condition[2] === null) + { + $condition[2] = 'NULL'; + } + + $condition = implode(' ', $condition); + + break; + default: $condition = implode(' ', $condition); -- cgit v1.2.1 From 84150d0d440d552ff45b5875edf28f6d7fda0f9c Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Wed, 14 Oct 2015 17:15:09 +0200 Subject: [ticket/13652] Fix coding style PHPBB3-13652 --- phpBB/phpbb/db/driver/driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/driver/driver.php') diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index e497e6dda1..7e2d7a5ea6 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -915,7 +915,7 @@ abstract class driver implements driver_interface } - if($operation === 'NOT') + if ($operation === 'NOT') { $operations_ary = implode("", $operations_ary); } -- cgit v1.2.1 From bb260f02e0de549f0ac2327b1d7b4f4a236a9a2a Mon Sep 17 00:00:00 2001 From: brunoais Date: Sat, 24 Oct 2015 14:36:41 +0100 Subject: [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(-) (limited to 'phpBB/phpbb/db/driver/driver.php') 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; -- cgit v1.2.1 From 9725f5757e590ac6a2eecb5735f1d15bc5c4e8db Mon Sep 17 00:00:00 2001 From: brunoais Date: Wed, 11 Nov 2015 08:35:28 +0000 Subject: [feature/sql-bool-builder] Changing syntax pt3. Don't use magic numbers PHPBB3-13652 --- phpBB/phpbb/db/driver/driver.php | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'phpBB/phpbb/db/driver/driver.php') diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index 410dd17b32..c7305e61a7 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -66,6 +66,15 @@ abstract class driver implements driver_interface */ var $sql_server_version = false; + const LOGICAL_OP = 0; + const STATEMENTS = 1; + const LEFT_STMT = 0; + const COMPARE_OP = 1; + const RIGHT_STMT = 2; + const SUBQUERY_OP = 3; + const SUBQUERY_SELECT_TYPE = 4; + const SUBQUERY_BUILD = 5; + /** * Constructor */ @@ -809,8 +818,8 @@ abstract class driver implements driver_interface { // In cases where an array exists but there is no head condition, // it should be because there's only 1 WHERE clause. This seems the best way to deal with it. - if ($operations_ary[0] !== 'AND' && - $operations_ary[0] !== 'OR') + if ($operations_ary[self::LOGICAL_OP] !== 'AND' && + $operations_ary[self::LOGICAL_OP] !== 'OR') { $operations_ary = array('AND', array($operations_ary)); } @@ -819,11 +828,11 @@ abstract class driver implements driver_interface protected function _process_boolean_tree($operations_ary) { - $operation = $operations_ary[0]; + $operation = $operations_ary[self::LOGICAL_OP]; foreach ($operations_ary[1] as &$condition) { - switch ($condition[0]) + switch ($condition[self::LOGICAL_OP]) { case 'AND': case 'OR': @@ -844,40 +853,40 @@ abstract class driver implements driver_interface case 3: // Typical 3 element clause with {left hand} {operator} {right hand} - switch ($condition[1]) + switch ($condition[self::COMPARE_OP]) { case 'IN': case 'NOT_IN': // As this is used with an IN, assume it is a set of elements for sql_in_set() - $condition = $this->sql_in_set($condition[0], $condition[2], $condition[1] === 'NOT_IN', true); + $condition = $this->sql_in_set($condition[self::LEFT_STMT], $condition[self::RIGHT_STMT], $condition[Cself::OMPARE_OP] === 'NOT_IN', true); break; case 'LIKE': - $condition = $condition[0] . ' ' . $this->sql_like_expression($condition[2]) . ' '; + $condition = $condition[self::LEFT_STMT] . ' ' . $this->sql_like_expression($condition[self::RIGHT_STMT]) . ' '; break; case 'NOT_LIKE': - $condition = $condition[0] . ' ' . $this->sql_not_like_expression($condition[2]) . ' '; + $condition = $condition[self::LEFT_STMT] . ' ' . $this->sql_not_like_expression($condition[self::RIGHT_STMT]) . ' '; break; case 'IS_NOT': - $condition[1] = 'IS NOT'; + $condition[self::COMPARE_OP] = 'IS NOT'; // no break case 'IS': // If the value is NULL, the string of it is the empty string ('') which is not the intended result. // this should solve that - if ($condition[2] === null) + if ($condition[self::RIGHT_STMT] === null) { - $condition[2] = 'NULL'; + $condition[self::RIGHT_STMT] = 'NULL'; } $condition = implode(' ', $condition); @@ -897,8 +906,8 @@ abstract class driver implements driver_interface // Subquery with {left hand} {operator} {compare kind} {SELECT Kind } {Sub Query} - $condition = $condition[0] . ' ' . $condition[1] . ' ' . $condition[2] . ' ( '; - $condition .= $this->sql_build_query($condition[3], $condition[4]); + $condition = $condition[self::LEFT_STMT] . ' ' . $condition[self::COMPARE_OP] . ' ' . $condition[self::SUBQUERY_OP] . ' ( '; + $condition .= $this->sql_build_query($condition[self::SUBQUERY_SELECT_TYPE], $condition[self::SUBQUERY_BUILD]); $condition .= ' )'; break; @@ -917,11 +926,11 @@ abstract class driver implements driver_interface if ($operation === 'NOT') { - $operations_ary = implode("", $operations_ary[1]); + $operations_ary = implode("", $operations_ary[self::STATEMENTS]); } else { - $operations_ary = implode(" \n $operation ", $operations_ary[1]); + $operations_ary = implode(" \n $operation ", $operations_ary[self::STATEMENTS]); } return $operations_ary; -- cgit v1.2.1 From 335be2e59fe9f5b63391a04ce7d79af56a4801a0 Mon Sep 17 00:00:00 2001 From: brunoais Date: Thu, 12 Nov 2015 06:52:34 +0000 Subject: [feature/sql-bool-builder] Fixing typos in previous commit PHPBB3-13652 --- phpBB/phpbb/db/driver/driver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/driver/driver.php') diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index c7305e61a7..a65d8caa52 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -830,7 +830,7 @@ abstract class driver implements driver_interface { $operation = $operations_ary[self::LOGICAL_OP]; - foreach ($operations_ary[1] as &$condition) + foreach ($operations_ary[self::LOGICAL_OP] as &$condition) { switch ($condition[self::LOGICAL_OP]) { @@ -859,7 +859,7 @@ abstract class driver implements driver_interface case 'NOT_IN': // As this is used with an IN, assume it is a set of elements for sql_in_set() - $condition = $this->sql_in_set($condition[self::LEFT_STMT], $condition[self::RIGHT_STMT], $condition[Cself::OMPARE_OP] === 'NOT_IN', true); + $condition = $this->sql_in_set($condition[self::LEFT_STMT], $condition[self::RIGHT_STMT], $condition[self::COMPARE_OP] === 'NOT_IN', true); break; -- cgit v1.2.1 From a3a163dea1c3ba23a1d3a1c80c4c63c6831c37df Mon Sep 17 00:00:00 2001 From: brunoais Date: Tue, 24 Nov 2015 07:31:37 +0000 Subject: [feature/sql-bool-builder] Fixing misuse of LOGICAL_OP instead of STATEMENTS PHPBB3-13652 --- phpBB/phpbb/db/driver/driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/driver/driver.php') diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index a65d8caa52..5f06cb08fc 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -830,7 +830,7 @@ abstract class driver implements driver_interface { $operation = $operations_ary[self::LOGICAL_OP]; - foreach ($operations_ary[self::LOGICAL_OP] as &$condition) + foreach ($operations_ary[self::STATEMENTS] as &$condition) { switch ($condition[self::LOGICAL_OP]) { -- cgit v1.2.1 From 7a6a16e3a52128179a4f518958f22e773dd94084 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 5 Dec 2015 13:45:16 +0100 Subject: [ticket/13454] Remove unused variables This is part 5 and there is more to come. PHPBB3-13454 --- phpBB/phpbb/db/driver/driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/driver/driver.php') diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index 5f06cb08fc..30cb667344 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -1012,7 +1012,7 @@ abstract class driver implements driver_interface */ function sql_report($mode, $query = '') { - global $cache, $starttime, $phpbb_root_path, $phpbb_path_helper, $user; + global $cache, $starttime, $phpbb_root_path, $phpbb_path_helper; global $request; if (is_object($request) && !$request->variable('explain', false)) -- cgit v1.2.1