mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/14241] Log fatal captcha error to error log
PHPBB3-14241
This commit is contained in:
parent
4c5c289f75
commit
215fad420f
2 changed files with 9 additions and 4 deletions
|
@ -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',
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue