From: Henry S. <kel...@ph...> - 2009-09-28 13:08:51
|
Author: Kellanved Date: Mon Sep 28 14:08:33 2009 New Revision: 10193 Log: Fail without notices when no questions are provided Authorised by: AcydBurn Modified: branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php Modified: branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php (original) --- branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php Mon Sep 28 14:08:33 2009 *************** *** 349,355 **** global $config, $db, $user; $error = ''; ! if (!$this->confirm_id) { $error = $user->lang['CONFIRM_QUESTION_WRONG']; --- 349,360 ---- global $config, $db, $user; $error = ''; ! ! if (!sizeof($this->question_ids)) ! { ! return false; ! } ! if (!$this->confirm_id) { $error = $user->lang['CONFIRM_QUESTION_WRONG']; *************** *** 388,393 **** --- 393,403 ---- { 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,414 **** --- 419,429 ---- 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,454 **** --- 464,474 ---- 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 |