Skip to content
Permalink
Browse files

Fix bans list ordered by IP (#219)

Ref #1125
  • Loading branch information...
Quy authored and franzliedke committed Feb 20, 2019
1 parent c2c8856 commit 5c5bcfa8ad7dc7f5503cfc7fd1e35fd5640121e6
Showing with 2 additions and 2 deletions.
  1. +2 −2 admin_bans.php
@@ -365,7 +365,7 @@
$expire_after = isset($_GET['expire_after']) ? pun_trim($_GET['expire_after']) : '';
$expire_before = isset($_GET['expire_before']) ? pun_trim($_GET['expire_before']) : '';
$order_by = isset($_GET['order_by']) && in_array($_GET['order_by'], array('username', 'ip', 'email', 'expire')) ? 'b.'.$_GET['order_by'] : 'b.username';
$order_by = isset($_GET['order_by']) && in_array($_GET['order_by'], array('username', 'ip', 'email', 'expire')) ? $_GET['order_by'] : 'username';
$direction = isset($_GET['direction']) && $_GET['direction'] == 'DESC' ? 'DESC' : 'ASC';
$query_str[] = 'order_by='.$order_by;
@@ -455,7 +455,7 @@
<tbody>
<?php
$result = $db->query('SELECT b.id, b.username, b.ip, b.email, b.message, b.expire, b.ban_creator, u.username AS ban_creator_username FROM '.$db->prefix.'bans AS b LEFT JOIN '.$db->prefix.'users AS u ON b.ban_creator=u.id WHERE b.id>0'.(!empty($conditions) ? ' AND '.implode(' AND ', $conditions) : '').' ORDER BY '.$db->escape($order_by).' '.$db->escape($direction).' LIMIT '.$start_from.', 50') or error('Unable to fetch ban list', __FILE__, __LINE__, $db->error());
$result = $db->query('SELECT b.id, b.username, b.ip, b.email, b.message, b.expire, b.ban_creator, u.username AS ban_creator_username FROM '.$db->prefix.'bans AS b LEFT JOIN '.$db->prefix.'users AS u ON b.ban_creator=u.id WHERE b.id>0'.(!empty($conditions) ? ' AND '.implode(' AND ', $conditions) : '').' ORDER BY b.'.$db->escape($order_by).' '.$db->escape($direction).' LIMIT '.$start_from.', 50') or error('Unable to fetch ban list', __FILE__, __LINE__, $db->error());
if ($db->has_rows($result))
{
while ($ban_data = $db->fetch_assoc($result))

0 comments on commit 5c5bcfa

Please sign in to comment.
You can’t perform that action at this time.