From 692ca79d8b7bcfb27f7d579fafc7470866374dcb Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Sat, 17 Oct 2015 23:57:36 +0100 Subject: [PATCH] Don't include post messages in public banlist --- inc/bans.php | 4 ++-- templates/themes/public_banlist/theme.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/bans.php b/inc/bans.php index 87e06e28..dcca1366 100644 --- a/inc/bans.php +++ b/inc/bans.php @@ -149,7 +149,7 @@ class Bans { return $ban_list; } - static public function stream_json($out = false, $filter_ips = false, $filter_staff = false, $board_access = false) { + static public function stream_json($out = false, $filter_ips = false, $filter_staff = false, $board_access = false, $hide_message = false) { $query = query("SELECT ``bans``.*, `username` FROM ``bans`` LEFT JOIN ``mods`` ON ``mods``.`id` = `creator` ORDER BY `created` DESC") or error(db_error()); @@ -164,7 +164,7 @@ class Bans { foreach ($bans as &$ban) { $ban['mask'] = self::range_to_string(array($ban['ipstart'], $ban['ipend'])); - if ($ban['post']) { + if ($ban['post'] && !$hide_message) { $post = json_decode($ban['post']); $ban['message'] = $post->body; } diff --git a/templates/themes/public_banlist/theme.php b/templates/themes/public_banlist/theme.php index f2b65839..93b78677 100644 --- a/templates/themes/public_banlist/theme.php +++ b/templates/themes/public_banlist/theme.php @@ -25,7 +25,7 @@ public static function gen_json($settings) { ob_start(); - Bans::stream_json(false, true, true, array()); + Bans::stream_json(false, true, true, array(), true); $out = ob_get_contents(); ob_end_clean(); return $out;