From 345de34ac1645f578498930a7927e1cf9a6b94e7 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Tue, 26 Jan 2010 11:07:47 +0000 Subject: [PATCH] tuning git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10451 89ea8834-ac86-4346-8a33-228a782c2dd0 --- .../captcha/plugins/phpbb_captcha_qa_plugin.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php b/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php index 7526cb67cf..c121af5b3a 100644 --- a/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php +++ b/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php @@ -253,11 +253,11 @@ class phpbb_captcha_qa /** * API function */ - function garbage_collect($type) + function garbage_collect($type = 0) { global $db, $config; - $sql = 'SELECT DISTINCT c.session_id + $sql = 'SELECT c.question_id FROM ' . CAPTCHA_QA_CONFIRM_TABLE . ' c LEFT JOIN ' . SESSIONS_TABLE . ' s ON (c.session_id = s.session_id) @@ -266,19 +266,19 @@ class phpbb_captcha_qa $result = $db->sql_query($sql); if ($row = $db->sql_fetchrow($result)) - { + {print_r($row); $sql_in = array(); do { - $sql_in[] = (string) $row['session_id']; + $sql_in[] = (string) $row['question_id']; } while ($row = $db->sql_fetchrow($result)); if (sizeof($sql_in)) { $sql = 'DELETE FROM ' . CAPTCHA_QA_CONFIRM_TABLE . ' - WHERE ' . $db->sql_in_set('session_id', $sql_in); + WHERE ' . $db->sql_in_set('question_id', $sql_in); $db->sql_query($sql); } }