aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_validate.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions_validate.php')
-rw-r--r--phpBB/includes/functions_validate.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/phpBB/includes/functions_validate.php b/phpBB/includes/functions_validate.php
index 1f70cf2e7e..c9c9724368 100644
--- a/phpBB/includes/functions_validate.php
+++ b/phpBB/includes/functions_validate.php
@@ -58,13 +58,15 @@ function validate_username($username)
}
$sql = "SELECT disallow_username
- FROM " . DISALLOW_TABLE . "
- WHERE disallow_username LIKE '$username'";
+ FROM " . DISALLOW_TABLE;
if ( $result = $db->sql_query($sql) )
{
- if ( $db->sql_fetchrow($result) )
+ while( $row = $db->sql_fetchrow($result) )
{
- return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
+ if ( preg_match("#\b(" . str_replace("\*", "\w*?", preg_quote($row['disallow_username'])) . ")\b#i", $username) )
+ {
+ return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
+ }
}
}