From 7b551adb2b83482fd81f055aa643ab74f2fa2c44 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 29 Jul 2023 23:11:22 +0200 Subject: [PATCH] [ticket/9687] Prevent banning of anonymous PHPBB3-9687 --- phpBB/phpbb/ban/type/user.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/phpBB/phpbb/ban/type/user.php b/phpBB/phpbb/ban/type/user.php index ea79cffc35..9598b61f29 100644 --- a/phpBB/phpbb/ban/type/user.php +++ b/phpBB/phpbb/ban/type/user.php @@ -102,9 +102,12 @@ class user extends base // Fill excluded user list $this->get_excluded(); + // Prevent banning of anonymous + $this->excluded[ANONYMOUS] = ANONYMOUS; + $sql_usernames = []; $sql_or_like = []; - foreach ($items as $item) // TODO: Prevent banning Anonymous + foreach ($items as $item) { $cleaned_username = utf8_clean_string($item); if (stripos($cleaned_username, '*') === false)