[ticket/11720] Do not call $captcha->validate if $captcha is not set

PHPBB3-11566 changed big parts of code. Unfortunately, a call to
$captcha->validate was added that is being called even if $captcha hasn't
been initialized. This change will fix this issue.

PHPBB3-11720
This commit is contained in:
Marc Alexander 2013-07-20 22:02:51 +02:00
parent 036a4188f3
commit 56df3fd8ca

View file

@ -145,12 +145,15 @@ $s_hidden_fields = '';
// Submit report? // Submit report?
if ($submit && $reason_id) if ($submit && $reason_id)
{
if (isset($captcha))
{ {
$visual_confirmation_response = $captcha->validate(); $visual_confirmation_response = $captcha->validate();
if ($visual_confirmation_response) if ($visual_confirmation_response)
{ {
$error[] = $visual_confirmation_response; $error[] = $visual_confirmation_response;
} }
}
$sql = 'SELECT * $sql = 'SELECT *
FROM ' . REPORTS_REASONS_TABLE . " FROM ' . REPORTS_REASONS_TABLE . "