aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/avatar/driver/local.php2
-rw-r--r--phpBB/phpbb/log/log.php31
2 files changed, 17 insertions, 16 deletions
diff --git a/phpBB/phpbb/avatar/driver/local.php b/phpBB/phpbb/avatar/driver/local.php
index 00e519e3f2..c9e6781205 100644
--- a/phpBB/phpbb/avatar/driver/local.php
+++ b/phpBB/phpbb/avatar/driver/local.php
@@ -36,7 +36,7 @@ class local extends \phpbb\avatar\driver\driver
public function prepare_form($request, $template, $user, $row, &$error)
{
$avatar_list = $this->get_avatar_list($user);
- $category = $request->variable('avatar_local_cat', '');
+ $category = $request->variable('avatar_local_cat', key($avatar_list));
foreach ($avatar_list as $cat => $null)
{
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 ';