From b206d63c51a514f3676f905dc2f11f474ba088fc Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 22 Mar 2006 10:17:48 +0000 Subject: [PATCH] do not validate username when disallowing it. ;) - #1220 git-svn-id: file:///svn/phpbb/trunk@5694 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_disallow.php | 17 +++++++++-------- phpBB/language/en/acp/posting.php | 3 ++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/phpBB/includes/acp/acp_disallow.php b/phpBB/includes/acp/acp_disallow.php index 2e02fb4e83..0a447a81de 100644 --- a/phpBB/includes/acp/acp_disallow.php +++ b/phpBB/includes/acp/acp_disallow.php @@ -34,17 +34,18 @@ class acp_disallow if ($disallow) { $disallowed_user = str_replace('*', '%', request_var('disallowed_user', '')); - $message = validate_username($disallowed_user); - if (!$message) + if (!$disallowed_user) { - $sql = 'INSERT INTO ' . DISALLOW_TABLE . ' ' . $db->sql_build_array('INSERT', array('disallow_username' => $disallowed_user)); - $db->sql_query($sql); - - $message = $user->lang['DISALLOW_SUCCESSFUL']; - add_log('admin', 'LOG_DISALLOW_ADD', str_replace('%', '*', $disallowed_user)); + trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action)); } + $sql = 'INSERT INTO ' . DISALLOW_TABLE . ' ' . $db->sql_build_array('INSERT', array('disallow_username' => $disallowed_user)); + $db->sql_query($sql); + + $message = $user->lang['DISALLOW_SUCCESSFUL']; + add_log('admin', 'LOG_DISALLOW_ADD', str_replace('%', '*', $disallowed_user)); + trigger_error($message . adm_back_link($this->u_action)); } else if ($allow) @@ -53,7 +54,7 @@ class acp_disallow if (!$disallowed_id) { - trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action)); } $sql = 'DELETE FROM ' . DISALLOW_TABLE . " diff --git a/phpBB/language/en/acp/posting.php b/phpBB/language/en/acp/posting.php index b61291eec2..b5043b8dd5 100644 --- a/phpBB/language/en/acp/posting.php +++ b/phpBB/language/en/acp/posting.php @@ -197,7 +197,8 @@ $lang = array_merge($lang, array( 'DISALLOWED_DELETED' => 'The disallowed username has been successfully removed', 'DISALLOW_SUCCESSFUL' => 'The disallowed username has been successfully added', - 'NO_DISALLOWED' => 'No Disallowed Usernames', + 'NO_DISALLOWED' => 'No Disallowed Usernames', + 'NO_USERNAME_SPECIFIED' => 'You haven\'t selected or entered a username to operate with.', )); // Reasons