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
This commit is contained in:
Henry Sudhof 2009-09-28 13:08:33 +00:00
parent 4208ed9c57
commit 19b417cee9

View file

@ -350,6 +350,11 @@ class phpbb_captcha_qa
$error = ''; $error = '';
if (!sizeof($this->question_ids))
{
return false;
}
if (!$this->confirm_id) if (!$this->confirm_id)
{ {
$error = $user->lang['CONFIRM_QUESTION_WRONG']; $error = $user->lang['CONFIRM_QUESTION_WRONG'];
@ -388,6 +393,11 @@ class phpbb_captcha_qa
{ {
global $db, $user; global $db, $user;
if (!sizeof($this->question_ids))
{
return false;
}
$this->confirm_id = md5(unique_id($user->ip)); $this->confirm_id = md5(unique_id($user->ip));
$this->question = (int) array_rand($this->question_ids); $this->question = (int) array_rand($this->question_ids);
@ -410,6 +420,11 @@ class phpbb_captcha_qa
{ {
global $db, $user; global $db, $user;
if (!sizeof($this->question_ids))
{
return false;
}
$this->question = (int) array_rand($this->question_ids); $this->question = (int) array_rand($this->question_ids);
$this->solved = 0; $this->solved = 0;
@ -450,6 +465,11 @@ class phpbb_captcha_qa
{ {
global $db, $user; global $db, $user;
if (!sizeof($this->question_ids))
{
return false;
}
$sql = 'SELECT con.question_id, attempts, question_text, strict $sql = 'SELECT con.question_id, attempts, question_text, strict
FROM ' . CAPTCHA_QA_CONFIRM_TABLE . ' con, ' . CAPTCHA_QUESTIONS_TABLE . " qes FROM ' . CAPTCHA_QA_CONFIRM_TABLE . ' con, ' . CAPTCHA_QUESTIONS_TABLE . " qes
WHERE con.question_id = qes.question_id WHERE con.question_id = qes.question_id