mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 12:28:52 +00:00
[ticket/9687] Fix bugs when banning and add TODO's
PHPBB3-9687
This commit is contained in:
parent
728b200cd9
commit
64ab1fc24c
4 changed files with 6 additions and 5 deletions
|
@ -36,6 +36,6 @@ services:
|
||||||
- '@dbal.conn'
|
- '@dbal.conn'
|
||||||
- '@log'
|
- '@log'
|
||||||
- '@user'
|
- '@user'
|
||||||
- '%tables.users'
|
- '%tables.users%'
|
||||||
tags:
|
tags:
|
||||||
- { name: ban.type }
|
- { name: ban.type }
|
||||||
|
|
|
@ -180,9 +180,10 @@ class manager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Prevent logging out founders
|
||||||
$sql = 'SELECT user_id
|
$sql = 'SELECT user_id
|
||||||
FROM ' . $this->users_table . '
|
FROM ' . $this->users_table . '
|
||||||
WHERE ' . $this->db->sql_in_set('u.' . $user_column, $ban_items_sql) . $ban_or_like;
|
WHERE ' . $this->db->sql_in_set('u.' . $user_column, $ban_items_sql, false, true) . $ban_or_like;
|
||||||
$result = $this->db->sql_query($sql);
|
$result = $this->db->sql_query($sql);
|
||||||
|
|
||||||
$user_ids = [];
|
$user_ids = [];
|
||||||
|
|
|
@ -60,13 +60,13 @@ class email extends base
|
||||||
{
|
{
|
||||||
throw new runtime_exception(); // TODO
|
throw new runtime_exception(); // TODO
|
||||||
}
|
}
|
||||||
$regex = '#^.*?@*|(([a-z0-9\-]+\.)+([a-z]{2,3}))$#i';
|
$regex = '#^.*?@.*|(([a-z0-9\-]+\.)+([a-z]{2,3}))$#i';
|
||||||
|
|
||||||
$ban_items = [];
|
$ban_items = [];
|
||||||
foreach ($items as $item)
|
foreach ($items as $item)
|
||||||
{
|
{
|
||||||
$item = trim($item);
|
$item = trim($item);
|
||||||
if (strlen($item) > 100 || preg_match($regex, $item) || in_array($item, $this->excluded))
|
if (strlen($item) > 100 || !preg_match($regex, $item) || in_array($item, $this->excluded))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,7 +166,7 @@ class user extends base
|
||||||
|
|
||||||
$sql_usernames = [];
|
$sql_usernames = [];
|
||||||
$sql_or_like = [];
|
$sql_or_like = [];
|
||||||
foreach ($items as $item)
|
foreach ($items as $item) // TODO: Prevent banning Anonymous
|
||||||
{
|
{
|
||||||
$cleaned_username = utf8_clean_string($item);
|
$cleaned_username = utf8_clean_string($item);
|
||||||
if (stripos($cleaned_username, '*') === false)
|
if (stripos($cleaned_username, '*') === false)
|
||||||
|
|
Loading…
Add table
Reference in a new issue