From: Henry S. <kel...@ph...> - 2009-10-27 12:33:36
|
Author: Kellanved Date: Tue Oct 27 12:27:46 2009 New Revision: 10237 Log: #53235 - removing accidental commits 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 Tue Oct 27 12:27:46 2009 *************** *** 53,59 **** // read input $this->confirm_id = request_var('qa_confirm_id', ''); ! $this->answer = request_var('qa_answer', '', true); $this->type = (int) $type; $this->question_lang = $user->lang_name; --- 53,59 ---- // read input $this->confirm_id = request_var('qa_confirm_id', ''); ! $this->answer = utf8_normalize_nfc(request_var('qa_answer', '', true)); $this->type = (int) $type; $this->question_lang = $user->lang_name; *************** *** 349,360 **** global $config, $db, $user; $error = ''; ! if (!sizeof($this->question_ids)) { return false; } ! 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']; *************** *** 419,425 **** function reselect_question() { global $db, $user; ! if (!sizeof($this->question_ids)) { return false; --- 419,425 ---- function reselect_question() { global $db, $user; ! if (!sizeof($this->question_ids)) { return false; *************** *** 464,470 **** function load_answer() { global $db, $user; ! if (!sizeof($this->question_ids)) { return false; --- 464,470 ---- function load_answer() { global $db, $user; ! if (!sizeof($this->question_ids)) { return false; *************** *** 617,644 **** } else if ($question_id && $action == 'delete') { ! if ($this->get_class_name() !== $config['captcha_plugin'] || !$this->acp_is_last($question_id)) { ! if (confirm_box(true)) ! { ! $this->acp_delete_question($question_id); ! trigger_error($user->lang['QUESTION_DELETED'] . adm_back_link($list_url)); ! } ! else ! { ! confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( ! 'question_id' => $question_id, ! 'action' => $action, ! 'configure' => 1, ! 'select_captcha' => $this->get_class_name(), ! )) ! ); ! } } else { ! trigger_error($user->lang['QA_ERROR_MSG'] . adm_back_link($list_url), E_USER_WARNING); } } else --- 617,637 ---- } else if ($question_id && $action == 'delete') { ! if (confirm_box(true)) { ! $this->acp_delete_question($question_id); ! trigger_error($user->lang['QUESTION_DELETED'] . adm_back_link($list_url)); } else { ! confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( ! 'question_id' => $question_id, ! 'action' => $action, ! 'configure' => 1, ! 'select_captcha' => $this->get_class_name(), ! )) ! ); } } else *************** *** 718,724 **** } else if ($submit) { ! trigger_error($user->lang['FORM_INVALID'] . adm_back_link($list_url), E_USER_WARNING); } } } --- 711,717 ---- } else if ($submit) { ! trigger_error($user->lang['FORM_INVALID'] . adm_back_link($list_url)); } } } *************** *** 801,807 **** 'question_text' => request_var('question_text', '', true), 'strict' => request_var('strict', false), 'lang_iso' => request_var('lang_iso', ''), ! 'answers' => (strlen($answers)) ? explode("\n", $answers) : '', ); return $question; --- 794,800 ---- 'question_text' => request_var('question_text', '', true), 'strict' => request_var('strict', false), 'lang_iso' => request_var('lang_iso', ''), ! 'answers' => (strlen($answers)) ? explode("\n", request_var('answers', '', true)) : '', ); return $question; *************** *** 922,927 **** --- 915,921 ---- { return false; } + return true; } *************** *** 948,978 **** return $langs; } - - /** - * Grab a question and bring it into a format the editor understands - */ - function acp_is_last($question_id) - { - global $config, $db; - - if ($question_id) - { - $sql = 'SELECT question_id - FROM ' . CAPTCHA_QUESTIONS_TABLE . " - WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "' - AND question_id <> " . (int) $question_id; - $result = $db->sql_query_limit($sql, 1); - $question = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if (!$question) - { - return true; - } - return false; - } - } } ?> \ No newline at end of file --- 942,947 ---- |