diff options
author | Marc Alexander <admin@m-a-styles.de> | 2016-03-12 10:24:07 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2016-03-12 10:24:07 +0100 |
commit | 215fad420f20ba48cda00c7ceedfa31e035ee76f (patch) | |
tree | fe54d54e437c235b632f65824fb1f159935a8d7c | |
parent | 4c5c289f75c267e1f3e789c0304054ed4e3e2564 (diff) | |
download | forums-215fad420f20ba48cda00c7ceedfa31e035ee76f.tar forums-215fad420f20ba48cda00c7ceedfa31e035ee76f.tar.gz forums-215fad420f20ba48cda00c7ceedfa31e035ee76f.tar.bz2 forums-215fad420f20ba48cda00c7ceedfa31e035ee76f.tar.xz forums-215fad420f20ba48cda00c7ceedfa31e035ee76f.zip |
[ticket/14241] Log fatal captcha error to error log
PHPBB3-14241
-rw-r--r-- | phpBB/language/en/acp/common.php | 1 | ||||
-rw-r--r-- | phpBB/phpbb/captcha/plugins/qa.php | 12 |
2 files changed, 9 insertions, 4 deletions
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index fdbc4aebd0..88e60d00a3 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -594,6 +594,7 @@ $lang = array_merge($lang, array( 'LOG_ERROR_JABBER' => '<strong>Jabber error</strong><br />» %s', 'LOG_ERROR_EMAIL' => '<strong>Email error</strong><br />» %s', + 'LOG_ERROR_CAPTCHA' => '<strong>CAPTCHA error</strong><br />» %s', 'LOG_FORUM_ADD' => '<strong>Created new forum</strong><br />» %s', 'LOG_FORUM_COPIED_PERMISSIONS' => '<strong>Copied forum permissions</strong> from %1$s<br />» %2$s', diff --git a/phpBB/phpbb/captcha/plugins/qa.php b/phpBB/phpbb/captcha/plugins/qa.php index e6059b968f..8f2da838c5 100644 --- a/phpBB/phpbb/captcha/plugins/qa.php +++ b/phpBB/phpbb/captcha/plugins/qa.php @@ -220,10 +220,12 @@ class qa */ function get_template() { - global $template; + global $phpbb_log, $template, $user; - if ($this->is_solved() || !count($this->question_ids)) + if ($this->is_solved() || empty($this->question_text) || !count($this->question_ids)) { + /** @var \phpbb\log\log_interface $phpbb_log */ + $phpbb_log->add('critical', $user->data['user_id'], $user->ip, 'LOG_ERROR_CAPTCHA', time(), array($user->lang('CONFIRM_QUESTION_MISSING'))); return false; } else @@ -386,13 +388,15 @@ class qa */ function validate() { - global $user; + global $phpbb_log, $user; $error = ''; if (!sizeof($this->question_ids)) { - return $user->lang['CONFIRM_QUESTION_MISSING']; + /** @var \phpbb\log\log_interface $phpbb_log */ + $phpbb_log->add('critical', $user->data['user_id'], $user->ip, 'LOG_ERROR_CAPTCHA', time(), array($user->lang('CONFIRM_QUESTION_MISSING'))); + return $user->lang('CONFIRM_QUESTION_MISSING'); } if (!$this->confirm_id) |