diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2009-12-16 15:48:23 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2009-12-16 15:48:23 +0000 |
commit | b68de2323d6444b4b3685a98bbcb9500a38e45cb (patch) | |
tree | 6046a64891cfc1c2edb3f4b42b0e799f2921c155 /phpBB/includes/captcha/plugins | |
parent | 51d173ff1e6d3764be4701b92ecfd68007ad1c81 (diff) | |
download | forums-b68de2323d6444b4b3685a98bbcb9500a38e45cb.tar forums-b68de2323d6444b4b3685a98bbcb9500a38e45cb.tar.gz forums-b68de2323d6444b4b3685a98bbcb9500a38e45cb.tar.bz2 forums-b68de2323d6444b4b3685a98bbcb9500a38e45cb.tar.xz forums-b68de2323d6444b4b3685a98bbcb9500a38e45cb.zip |
merge changes from 3.0.x branch
git-svn-id: file:///svn/phpbb/trunk@10342 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/captcha/plugins')
-rw-r--r-- | phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php | 12 |
1 files changed, 7 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 c17cfa7bbe..45811c5d26 100644 --- a/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php +++ b/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php @@ -53,7 +53,7 @@ class phpbb_captcha_qa // read input $this->confirm_id = request_var('qa_confirm_id', ''); - $this->answer = request_var('qa_answer', '', true); + $this->answer = utf8_normalize_nfc(request_var('qa_answer', '', true)); $this->type = (int) $type; $this->question_lang = $user->lang_name; @@ -502,7 +502,7 @@ class phpbb_captcha_qa { global $db; - $answer = ($this->question_strict) ? request_var('qa_answer', '', true) : utf8_clean_string(request_var('qa_answer', '', true)); + $answer = ($this->question_strict) ? utf8_normalize_nfc(request_var('qa_answer', '', true)) : utf8_clean_string(utf8_normalize_nfc(request_var('qa_answer', '', true))); $sql = 'SELECT answer_text FROM ' . CAPTCHA_ANSWERS_TABLE . ' @@ -789,11 +789,12 @@ class phpbb_captcha_qa */ function acp_get_question_input() { + $answers = utf8_normalize_nfc(request_var('answers', '', true)); $question = array( 'question_text' => request_var('question_text', '', true), 'strict' => request_var('strict', false), 'lang_iso' => request_var('lang_iso', ''), - 'answers' => explode("\n", request_var('answers', '', true)), + 'answers' => (strlen($answers)) ? explode("\n", $answers) : '', ); return $question; @@ -908,8 +909,9 @@ class phpbb_captcha_qa } if (!isset($langs[$question_data['lang_iso']]) || - !$question_data['question_text'] || - !sizeof($question_data['answers'])) + !strlen($question_data['question_text']) || + !sizeof($question_data['answers']) || + !is_array($question_data['answers'])) { return false; } |