From b0217ddc11799f81c8cf42961f6e0db54ce2e38e Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 12 Nov 2006 15:17:46 +0000 Subject: banned usernames are now cached and normalized git-svn-id: file:///svn/phpbb/trunk@6571 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/cache.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'phpBB/includes/cache.php') diff --git a/phpBB/includes/cache.php b/phpBB/includes/cache.php index 8d6e17a8df..01dcf5b722 100644 --- a/phpBB/includes/cache.php +++ b/phpBB/includes/cache.php @@ -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; + } } ?> \ No newline at end of file -- cgit v1.2.1