phpBB

Code Changes

File: phpbb/captcha/plugins/qa.php

  Unmodified   Added   Modified   Removed
Line 21Line 21
{
var $confirm_id;
var $answer;

{
var $confirm_id;
var $answer;

	var $question_ids;

	var $question_ids = [];

	var $question_text;
var $question_lang;
var $question_strict;

	var $question_text;
var $question_lang;
var $question_strict;

Line 84Line 84
		$db->sql_freeresult($result);

// fallback to the board default lang

		$db->sql_freeresult($result);

// fallback to the board default lang

		if (!sizeof($this->question_ids))

		if (!count($this->question_ids))

		{
$this->question_lang = $config['default_lang'];


		{
$this->question_lang = $config['default_lang'];


Line 101Line 101
		}

// final fallback to any language

		}

// final fallback to any language

		if (!sizeof($this->question_ids))

		if (!count($this->question_ids))

		{
$this->question_lang = '';

$sql = 'SELECT q.question_id, q.lang_iso
FROM ' . $this->table_captcha_questions . ' q, ' . $this->table_captcha_answers . ' a

		{
$this->question_lang = '';

$sql = 'SELECT q.question_id, q.lang_iso
FROM ' . $this->table_captcha_questions . ' q, ' . $this->table_captcha_answers . ' a

				WHERE q.question_id = a.question_id
GROUP BY lang_iso';

				WHERE q.question_id = a.question_id';


			$result = $db->sql_query($sql, 7200);

while ($row = $db->sql_fetchrow($result))

			$result = $db->sql_query($sql, 7200);

while ($row = $db->sql_fetchrow($result))

Line 311Line 310
			}
while ($row = $db->sql_fetchrow($result));


			}
while ($row = $db->sql_fetchrow($result));


			if (sizeof($sql_in))

			if (count($sql_in))

			{
$sql = 'DELETE FROM ' . $this->table_qa_confirm . '
WHERE ' . $db->sql_in_set('confirm_id', $sql_in);

			{
$sql = 'DELETE FROM ' . $this->table_qa_confirm . '
WHERE ' . $db->sql_in_set('confirm_id', $sql_in);

Line 395Line 394

$error = '';



$error = '';


		if (!sizeof($this->question_ids))

		if (!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')));

		{
/** @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')));

Line 439Line 438
	{
global $db, $user;


	{
global $db, $user;


		if (!sizeof($this->question_ids))

		if (!count($this->question_ids))

		{
return;
}

		{
return;
}

Line 465Line 464
	{
global $db, $user;


	{
global $db, $user;


		if (!sizeof($this->question_ids))

		if (!count($this->question_ids))

		{
return;
}

		{
return;
}

Line 536Line 535
	{
global $db, $user;


	{
global $db, $user;


		if (!strlen($this->confirm_id) || !sizeof($this->question_ids))

		if (!strlen($this->confirm_id) || !count($this->question_ids))

		{
return false;
}

		{
return false;
}

Line 638Line 637
	/**
* API function - The ACP backend, this marks the end of the easy methods
*/

	/**
* API function - The ACP backend, this marks the end of the easy methods
*/

	function acp_page($id, &$module)

	function acp_page($id, $module)

	{
global $config, $request, $phpbb_log, $template, $user;


	{
global $config, $request, $phpbb_log, $template, $user;


Line 776Line 775
	/**
* This handles the list overview
*/

	/**
* This handles the list overview
*/

	function acp_question_list(&$module)

	function acp_question_list($module)

	{
global $db, $template;


	{
global $db, $template;


Line 979Line 978

if (!isset($langs[$question_data['lang_iso']]) ||
!strlen($question_data['question_text']) ||


if (!isset($langs[$question_data['lang_iso']]) ||
!strlen($question_data['question_text']) ||

			!sizeof($question_data['answers']) ||

			!count($question_data['answers']) ||

			!is_array($question_data['answers']))
{
return false;

			!is_array($question_data['answers']))
{
return false;