diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_logs.php | 12 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_logs.php | 10 |
2 files changed, 18 insertions, 4 deletions
diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php index 2c795bb77b..4e5db058fb 100644 --- a/phpBB/includes/acp/acp_logs.php +++ b/phpBB/includes/acp/acp_logs.php @@ -26,7 +26,7 @@ class acp_logs { global $db, $user, $auth, $template, $cache, $phpbb_container; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; - global $request; + global $request, $phpbb_log; $user->add_lang('mcp'); @@ -66,7 +66,15 @@ class acp_logs unset($sql_in); } - if ($where_sql || $deleteall) + if ($deleteall) + { + $where_sql = ($sort_days) ? 'AND log_time >= ' . (time() - ($sort_days * 86400)) : ''; + $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); + $keywords_where = $phpbb_log->generate_sql_keyword($keywords, ''); + $where_sql .= ' ' . $keywords_where; + } + + if ($where_sql) { $sql = 'DELETE FROM ' . LOG_TABLE . " WHERE log_type = {$this->log_type} diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php index 7bcb0fc477..c51877002b 100644 --- a/phpBB/includes/mcp/mcp_logs.php +++ b/phpBB/includes/mcp/mcp_logs.php @@ -33,7 +33,7 @@ class mcp_logs function main($id, $mode) { global $auth, $db, $user, $template; - global $config, $phpbb_root_path, $phpEx, $phpbb_container; + global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_log; $user->add_lang('acp/common'); @@ -121,9 +121,15 @@ class mcp_logs } else if ($deleteall) { + $where_sql = ($sort_days) ? 'AND log_time >= ' . (time() - ($sort_days * 86400)) : ''; + $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); + $keywords_where = $phpbb_log->generate_sql_keyword($keywords, ''); + $where_sql .= ' ' . $keywords_where; + $sql = 'DELETE FROM ' . LOG_TABLE . ' WHERE log_type = ' . LOG_MOD . ' - AND ' . $db->sql_in_set('forum_id', $forum_list); + AND ' . $db->sql_in_set('forum_id', $forum_list) . + $where_sql; if ($mode == 'topic_logs') { |