1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-05 00:07:44 +02:00

[ticket/14241] Log fatal captcha error to error log

PHPBB3-14241
This commit is contained in:
Marc Alexander
2016-03-12 10:24:07 +01:00
parent 4c5c289f75
commit 215fad420f
2 changed files with 9 additions and 4 deletions

View File

@@ -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)