diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2009-07-24 08:49:51 +0000 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2009-07-24 08:49:51 +0000 |
commit | 224aa404f6c8f0014a0dc48b9776ff431b8d4f48 (patch) | |
tree | 49c1f3872a66c58cafd298cb344c08e616b1b474 /phpBB/includes/functions_user.php | |
parent | 89332c00b7198b5bd07fdb98b21d4734c300da15 (diff) | |
download | forums-224aa404f6c8f0014a0dc48b9776ff431b8d4f48.tar forums-224aa404f6c8f0014a0dc48b9776ff431b8d4f48.tar.gz forums-224aa404f6c8f0014a0dc48b9776ff431b8d4f48.tar.bz2 forums-224aa404f6c8f0014a0dc48b9776ff431b8d4f48.tar.xz forums-224aa404f6c8f0014a0dc48b9776ff431b8d4f48.zip |
Fix bug #47825 - Banning an already banned user states to be successful, but has no effect - Patch by Pyramide
Authorised by: AcydBurn
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9840 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r-- | phpBB/includes/functions_user.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index c69c27c9d7..e8584239ad 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1016,7 +1016,17 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas } while ($row = $db->sql_fetchrow($result)); - $banlist_ary = array_unique(array_diff($banlist_ary, $banlist_ary_tmp)); + $banlist_ary_tmp = array_intersect($banlist_ary, $banlist_ary_tmp); + + if (sizeof($banlist_ary_tmp)) + { + // One or more entities are already banned/excluded, delete the existing bans, so they can be re-inserted with the given new length + $sql = 'DELETE FROM ' . BANLIST_TABLE . ' + WHERE ' . $db->sql_in_set($type, $banlist_ary_tmp) . ' + AND ban_exclude = ' . (int) $ban_exclude; + $db->sql_query($sql); + } + unset($banlist_ary_tmp); } $db->sql_freeresult($result); |