mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
banned usernames are now cached and normalized
git-svn-id: file:///svn/phpbb/trunk@6571 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -354,6 +354,29 @@ class cache extends acm
|
||||
|
||||
return $parsed_items;
|
||||
}
|
||||
|
||||
function obtain_disallowed_usernames(&$usernames)
|
||||
{
|
||||
if (($usernames = $this->get('disallowed_usernames')) === false)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$sql = 'SELECT disallow_username
|
||||
FROM ' . DISALLOW_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$usernames = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$usernames[] = utf8_clean_string(str_replace('%', '.*?', preg_quote($row['disallow_username'], '$#')));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$this->put('disallowed_usernames', $usernames);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user