diff --git a/Sources/Actions/Admin/AntiSpam.php b/Sources/Actions/Admin/AntiSpam.php index 68ee4b5b79..1d8153fdba 100644 --- a/Sources/Actions/Admin/AntiSpam.php +++ b/Sources/Actions/Admin/AntiSpam.php @@ -18,13 +18,10 @@ use SMF\ActionInterface; use SMF\ActionTrait; use SMF\BackwardCompatibility; -use SMF\Cache\CacheApi; use SMF\Config; -use SMF\Db\DatabaseApi as Db; use SMF\IntegrationHook; use SMF\Lang; use SMF\Menu; -use SMF\Theme; use SMF\User; use SMF\Utils; @@ -50,78 +47,6 @@ public function execute(): void // You need to be an admin to edit settings! User::$me->isAllowedTo('admin_forum'); - // Generate a sample registration image. - Utils::$context['verification_image_href'] = Config::$scripturl . '?action=verificationcode;rand=' . bin2hex(random_bytes(16)); - - // Firstly, figure out what languages we're dealing with, and do a little processing for the form's benefit. - Lang::get(); - Utils::$context['qa_languages'] = []; - - foreach (Utils::$context['languages'] as $lang_id => $lang) { - $lang_id = strtr($lang_id, ['-utf8' => '']); - $lang['name'] = strtr($lang['name'], ['-utf8' => '']); - Utils::$context['qa_languages'][$lang_id] = $lang; - } - - // Secondly, load any questions we currently have. - Utils::$context['question_answers'] = []; - - $request = Db::$db->query( - 'SELECT id_question, lngfile, question, answers - FROM {db_prefix}qanda', - ); - - while ($row = Db::$db->fetch_assoc($request)) { - $lang = strtr($row['lngfile'], ['-utf8' => '']); - - Utils::$context['question_answers'][$row['id_question']] = [ - 'lngfile' => $lang, - 'question' => $row['question'], - 'answers' => (array) Utils::jsonDecode($row['answers'], true), - ]; - - Utils::$context['qa_by_lang'][$lang][] = $row['id_question']; - } - Db::$db->free_result($request); - - if (empty(Utils::$context['qa_by_lang'][strtr(Lang::$default, ['-utf8' => ''])]) && !empty(Utils::$context['question_answers'])) { - if (empty(Utils::$context['settings_insert_above'])) { - Utils::$context['settings_insert_above'] = ''; - } - - Utils::$context['settings_insert_above'] .= '