diff options
| author | Henry Sudhof <kellanved@phpbb.com> | 2009-09-28 13:08:33 +0000 |
|---|---|---|
| committer | Henry Sudhof <kellanved@phpbb.com> | 2009-09-28 13:08:33 +0000 |
| commit | 19b417cee97e9c0393c26727c7bc97bdefb8cd61 (patch) | |
| tree | 4e9f023557a15b0bcd1db4c9ff04abf8f6a36ac1 /phpBB/includes | |
| parent | 4208ed9c57cc515b3dc402e380ed62ed73b210c8 (diff) | |
| download | forums-19b417cee97e9c0393c26727c7bc97bdefb8cd61.tar forums-19b417cee97e9c0393c26727c7bc97bdefb8cd61.tar.gz forums-19b417cee97e9c0393c26727c7bc97bdefb8cd61.tar.bz2 forums-19b417cee97e9c0393c26727c7bc97bdefb8cd61.tar.xz forums-19b417cee97e9c0393c26727c7bc97bdefb8cd61.zip | |
Fail without notices when no questions are provided
Authorised by: AcydBurn
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10193 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php b/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php index 411d1366fa..c17cfa7bbe 100644 --- a/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php +++ b/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php @@ -349,7 +349,12 @@ class phpbb_captcha_qa global $config, $db, $user; $error = ''; - + + if (!sizeof($this->question_ids)) + { + return false; + } + if (!$this->confirm_id) { $error = $user->lang['CONFIRM_QUESTION_WRONG']; @@ -388,6 +393,11 @@ class phpbb_captcha_qa { global $db, $user; + + if (!sizeof($this->question_ids)) + { + return false; + } $this->confirm_id = md5(unique_id($user->ip)); $this->question = (int) array_rand($this->question_ids); @@ -409,6 +419,11 @@ class phpbb_captcha_qa function reselect_question() { global $db, $user; + + if (!sizeof($this->question_ids)) + { + return false; + } $this->question = (int) array_rand($this->question_ids); $this->solved = 0; @@ -449,6 +464,11 @@ class phpbb_captcha_qa function load_answer() { global $db, $user; + + if (!sizeof($this->question_ids)) + { + return false; + } $sql = 'SELECT con.question_id, attempts, question_text, strict FROM ' . CAPTCHA_QA_CONFIRM_TABLE . ' con, ' . CAPTCHA_QUESTIONS_TABLE . " qes |
