aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2009-06-13 12:40:15 +0000
committerAndreas Fischer <bantu@phpbb.com>2009-06-13 12:40:15 +0000
commit12de4efca49f8dea35d783db587696e37ef2355b (patch)
tree07f4d76cdb50dc21869b05000429d35e4542d236 /phpBB/includes
parent8c246032cc03ceceb8fcf24fe3802a1f8165de2f (diff)
downloadforums-12de4efca49f8dea35d783db587696e37ef2355b.tar
forums-12de4efca49f8dea35d783db587696e37ef2355b.tar.gz
forums-12de4efca49f8dea35d783db587696e37ef2355b.tar.bz2
forums-12de4efca49f8dea35d783db587696e37ef2355b.tar.xz
forums-12de4efca49f8dea35d783db587696e37ef2355b.zip
Fix bug #46255 - Allow friends/foes to be added and removed at the same time.
Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9577 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/ucp/ucp_zebra.php27
1 files changed, 15 insertions, 12 deletions
diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php
index fb5df9394b..c853c47026 100644
--- a/phpBB/includes/ucp/ucp_zebra.php
+++ b/phpBB/includes/ucp/ucp_zebra.php
@@ -52,6 +52,21 @@ class ucp_zebra
{
if (confirm_box(true))
{
+ // Remove users
+ if (!empty($data['usernames']))
+ {
+ // Force integer values
+ $data['usernames'] = array_map('intval', $data['usernames']);
+
+ $sql = 'DELETE FROM ' . ZEBRA_TABLE . '
+ WHERE user_id = ' . $user->data['user_id'] . '
+ AND ' . $db->sql_in_set('zebra_id', $data['usernames']);
+ $db->sql_query($sql);
+
+ $updated = true;
+ }
+
+ // Add users
if ($data['add'])
{
$data['add'] = array_map('trim', array_map('utf8_clean_string', explode("\n", $data['add'])));
@@ -183,18 +198,6 @@ class ucp_zebra
}
}
}
- else if (sizeof($data['usernames']))
- {
- // Force integer values
- $data['usernames'] = array_map('intval', $data['usernames']);
-
- $sql = 'DELETE FROM ' . ZEBRA_TABLE . '
- WHERE user_id = ' . $user->data['user_id'] . '
- AND ' . $db->sql_in_set('zebra_id', $data['usernames']);
- $db->sql_query($sql);
-
- $updated = true;
- }
if ($updated)
{