Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

#168: Fix yet another query bug and some undefined index errors.

  • Loading branch information...
commit bdf0877c3d38e2252b5a17d5610c1dece9d0c663 1 parent d07b4b6
@franzliedke franzliedke authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 admin_users.php
View
8 admin_users.php
@@ -261,7 +261,7 @@
confirm_referrer('admin_users.php');
- $user_ids = is_array($_POST['users']) ? array_keys($_POST['users']) : explode(',', $_POST['users']);
+ $user_ids = (isset($_POST['users']) && is_array($_POST['users'])) ? array_keys($_POST['users']) : explode(',', $_POST['users']);
$user_ids = array_map('intval', $user_ids);
// Delete invalid IDs
@@ -377,7 +377,7 @@
confirm_referrer('admin_users.php');
- $user_ids = is_array($_POST['users']) ? array_keys($_POST['users']) : explode(',', $_POST['users']);
+ $user_ids = (isset($_POST['users']) && is_array($_POST['users'])) ? array_keys($_POST['users']) : explode(',', $_POST['users']);
$user_ids = array_map('intval', $user_ids);
// Delete invalid IDs
@@ -515,7 +515,7 @@
confirm_referrer('admin_users.php');
- $user_ids = is_array($_POST['users']) ? array_keys($_POST['users']) : explode(',', $_POST['users']);
+ $user_ids = (isset($_POST['users']) && is_array($_POST['users']) ) ? array_keys($_POST['users']) : explode(',', $_POST['users']);
$user_ids = array_map('intval', $user_ids);
// Delete invalid IDs
@@ -532,7 +532,7 @@
// Also, moderators cannot ban other moderators
if ($pun_user['g_id'] != PUN_ADMIN)
{
- $result = $db->query('SELECT COUNT(u.*) FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id WHERE g.g_moderator=1 AND u.id IN ('.implode(',', $user_ids).')') or error('Unable to fetch moderator group info', __FILE__, __LINE__, $db->error());
+ $result = $db->query('SELECT COUNT(*) FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id WHERE g.g_moderator=1 AND u.id IN ('.implode(',', $user_ids).')') or error('Unable to fetch moderator group info', __FILE__, __LINE__, $db->error());
if ($db->result($result) > 0)
message($lang_admin_users['No ban mods message']);
}
Please sign in to comment.
Something went wrong with that request. Please try again.