1
0
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:
David M
2006-11-12 15:17:46 +00:00
parent 90b16076d3
commit b0217ddc11
3 changed files with 37 additions and 10 deletions

View File

@@ -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;
}
}
?>