1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-16 20:39:49 +02:00

[ticket/12639] Delete entry in admin-log leads to mysql-error

PHPBB3-12639
This commit is contained in:
Tristan Darricau 2014-05-31 12:56:44 +02:00
parent f4dcb69dae
commit 36071ded9d
3 changed files with 2 additions and 6 deletions

View File

@ -78,8 +78,6 @@ class acp_logs
$conditions['keywords'] = $keywords; $conditions['keywords'] = $keywords;
} }
$conditions['log_type'] = $this->log_type;
$phpbb_log = $phpbb_container->get('log'); $phpbb_log = $phpbb_container->get('log');
$phpbb_log->delete($mode, $conditions); $phpbb_log->delete($mode, $conditions);
} }

View File

@ -115,7 +115,6 @@ class mcp_logs
if ($deletemark && sizeof($marked)) if ($deletemark && sizeof($marked))
{ {
$conditions = array( $conditions = array(
'log_type' => LOG_MOD,
'forum_id' => $forum_list, 'forum_id' => $forum_list,
'log_id' => $marked, 'log_id' => $marked,
); );
@ -127,7 +126,6 @@ class mcp_logs
$keywords = utf8_normalize_nfc(request_var('keywords', '', true)); $keywords = utf8_normalize_nfc(request_var('keywords', '', true));
$conditions = array( $conditions = array(
'log_type' => LOG_MOD,
'forum_id' => $forum_list, 'forum_id' => $forum_list,
'keywords' => $keywords, 'keywords' => $keywords,
); );

View File

@ -393,14 +393,14 @@ class log implements \phpbb\log\log_interface
$sql_where = 'WHERE log_type = ' . $log_type; $sql_where = 'WHERE log_type = ' . $log_type;
foreach ($conditions as $field => $field_value) foreach ($conditions as $field => $field_value)
{ {
$sql_where .= ' AND ';
if ($field == 'keywords') if ($field == 'keywords')
{ {
$sql_where .= $this->generate_sql_keyword($field_value, '', ''); $sql_where .= $this->generate_sql_keyword($field_value, '', '');
} }
else else
{ {
$sql_where .= ' AND ';
if (is_array($field_value) && sizeof($field_value) == 2 && !is_array($field_value[1])) if (is_array($field_value) && sizeof($field_value) == 2 && !is_array($field_value[1]))
{ {
$sql_where .= $field . ' ' . $field_value[0] . ' ' . $field_value[1]; $sql_where .= $field . ' ' . $field_value[0] . ' ' . $field_value[1];