diff options
-rw-r--r-- | phpBB/includes/functions_user.php | 2 | ||||
-rw-r--r-- | phpBB/install/convertors/functions_phpbb20.php | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index cab9d8bc25..3c01186528 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1381,7 +1381,7 @@ function validate_username($username, $allowed_username = false) foreach ($bad_usernames as $bad_username) { - if (preg_match('#^' . $bad_username . '#', $clean_username)) + if (preg_match('#^' . str_replace('#', '\#', $bad_username) . '#', $clean_username)) { return 'USERNAME_DISALLOWED'; } diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 6788ecd900..a350ee8f4e 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -533,6 +533,14 @@ function phpbb_convert_authentication($mode) ORDER BY user_regdate ASC"; $result = $src_db->sql_query($sql); + + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = '" . $db->sql_escape('BOTS') . "'"; + $result = $db->sql_query($sql); + $bot_group_id = (int) $db->sql_fetchfield('group_id'); + $db->sql_freeresult($result); + while ($row = $src_db->sql_fetchrow($result)) { $user_id = (int) phpbb_user_id($row['user_id']); @@ -710,7 +718,7 @@ function phpbb_convert_authentication($mode) if ($mode == 'start') { user_group_auth('guests', 'SELECT user_id, {GUESTS} FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS, false); - user_group_auth('registered', 'SELECT user_id, {REGISTERED} FROM ' . USERS_TABLE . ' WHERE user_id <> ' . ANONYMOUS, false); + user_group_auth('registered', 'SELECT user_id, {REGISTERED} FROM ' . USERS_TABLE . ' WHERE user_id <> ' . ANONYMOUS . " AND group_id <> $bot_group_id", false); // Selecting from old table if (!empty($config['increment_user_id'])) |