mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 08:47:45 +02:00
Merge pull request #6599 from marc1706/ticket/12960
[ticket/12960] Remove broken captcha and add incomplete captcha as placeholder
This commit is contained in:
@@ -641,6 +641,9 @@ class acp_main
|
||||
}
|
||||
}
|
||||
|
||||
// Warn if incomplete captcha is enabled
|
||||
$this->check_captcha_type($config, $template);
|
||||
|
||||
if (!defined('PHPBB_DISABLE_CONFIG_CHECK'))
|
||||
{
|
||||
// World-Writable? (000x)
|
||||
@@ -673,4 +676,27 @@ class acp_main
|
||||
$this->tpl_name = 'acp_main';
|
||||
$this->page_title = 'ACP_MAIN';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check CAPTCHA type and output warning if incomplete type or unsafe config is used
|
||||
*
|
||||
* @param \phpbb\config\config $config
|
||||
* @param \phpbb\template\template $template
|
||||
* @return void
|
||||
*/
|
||||
protected function check_captcha_type(\phpbb\config\config $config, \phpbb\template\template $template): void
|
||||
{
|
||||
$template_vars = [];
|
||||
|
||||
if (!$config['enable_confirm'])
|
||||
{
|
||||
$template_vars['S_CAPTCHA_UNSAFE'] = true;
|
||||
}
|
||||
else if ($config['captcha_plugin'] == 'core.captcha.plugins.incomplete')
|
||||
{
|
||||
$template_vars['S_CAPTCHA_INCOMPLETE'] = true;
|
||||
}
|
||||
|
||||
$template->assign_vars($template_vars);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user