diff options
author | Andreas Fischer <bantu@phpbb.com> | 2014-06-04 23:59:20 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2014-06-04 23:59:20 +0200 |
commit | f9c0a6b96e12908e76a6835b98c46c27fe0cc322 (patch) | |
tree | bf82eb9244b7c600fe61aabc0ad7e51453764cd8 /phpBB/phpbb | |
parent | 1e7a782fb3d7d43f0338a719376a87170071b178 (diff) | |
parent | fb46e42ab3393f3899c0aa8b6b4482214ec1d275 (diff) | |
download | forums-f9c0a6b96e12908e76a6835b98c46c27fe0cc322.tar forums-f9c0a6b96e12908e76a6835b98c46c27fe0cc322.tar.gz forums-f9c0a6b96e12908e76a6835b98c46c27fe0cc322.tar.bz2 forums-f9c0a6b96e12908e76a6835b98c46c27fe0cc322.tar.xz forums-f9c0a6b96e12908e76a6835b98c46c27fe0cc322.zip |
Merge pull request #2526 from Nicofuma/ticket/12639
[ticket/12639] Delete entry in admin-log leads to mysql-error
* Nicofuma/ticket/12639:
[ticket/12639] Add a space in the code generated by generate_sql_keyword()
[ticket/12639] Handle $conditions['keywords'] outside of the loop
[ticket/12639] Don't make a copy of $marked when deleting logs in acp_logs
[ticket/12639] Send a correct IN entry when deleting marked logs
[ticket/12639] Use assertSame
[ticket/12639] Remove old commented tests
[ticket/12639] Order the results correctly in the test
[ticket/12639] Fix tests on postgres
[ticket/12639] Update tests to use a dataProvider
[ticket/12639] Add a test case with an empty keywords list
[ticket/12639] Delete entry in admin-log leads to mysql-error
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r-- | phpBB/phpbb/log/log.php | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/phpBB/phpbb/log/log.php b/phpBB/phpbb/log/log.php index 453cb740bb..10efe5fd1c 100644 --- a/phpBB/phpbb/log/log.php +++ b/phpBB/phpbb/log/log.php @@ -391,28 +391,29 @@ class log implements \phpbb\log\log_interface } $sql_where = 'WHERE log_type = ' . $log_type; + + if (isset($conditions['keywords'])) + { + $sql_where .= $this->generate_sql_keyword($conditions['keywords'], ''); + + unset($conditions['keywords']); + } + foreach ($conditions as $field => $field_value) { $sql_where .= ' AND '; - if ($field == 'keywords') + if (is_array($field_value) && sizeof($field_value) == 2 && !is_array($field_value[1])) + { + $sql_where .= $field . ' ' . $field_value[0] . ' ' . $field_value[1]; + } + else if (is_array($field_value) && isset($field_value['IN']) && is_array($field_value['IN'])) { - $sql_where .= $this->generate_sql_keyword($field_value, '', ''); + $sql_where .= $this->db->sql_in_set($field, $field_value['IN']); } else { - if (is_array($field_value) && sizeof($field_value) == 2 && !is_array($field_value[1])) - { - $sql_where .= $field . ' ' . $field_value[0] . ' ' . $field_value[1]; - } - else if (is_array($field_value) && isset($field_value['IN']) && is_array($field_value['IN'])) - { - $sql_where .= $this->db->sql_in_set($field, $field_value['IN']); - } - else - { - $sql_where .= $field . ' = ' . $field_value; - } + $sql_where .= $field . ' = ' . $field_value; } } @@ -781,7 +782,7 @@ class log implements \phpbb\log\log_interface } } - $sql_keywords = $statement_operator . ' ('; + $sql_keywords = ' ' . $statement_operator . ' ('; if (!empty($operations)) { $sql_keywords .= $this->db->sql_in_set($table_alias . 'log_operation', $operations) . ' OR '; |