Don't include post messages in public banlist

This commit is contained in:
Michael Walker 2015-10-17 23:57:36 +01:00
parent a144098c5c
commit 692ca79d8b
2 changed files with 3 additions and 3 deletions

View File

@ -149,7 +149,7 @@ class Bans {
return $ban_list; 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`` $query = query("SELECT ``bans``.*, `username` FROM ``bans``
LEFT JOIN ``mods`` ON ``mods``.`id` = `creator` LEFT JOIN ``mods`` ON ``mods``.`id` = `creator`
ORDER BY `created` DESC") or error(db_error()); ORDER BY `created` DESC") or error(db_error());
@ -164,7 +164,7 @@ class Bans {
foreach ($bans as &$ban) { foreach ($bans as &$ban) {
$ban['mask'] = self::range_to_string(array($ban['ipstart'], $ban['ipend'])); $ban['mask'] = self::range_to_string(array($ban['ipstart'], $ban['ipend']));
if ($ban['post']) { if ($ban['post'] && !$hide_message) {
$post = json_decode($ban['post']); $post = json_decode($ban['post']);
$ban['message'] = $post->body; $ban['message'] = $post->body;
} }

View File

@ -25,7 +25,7 @@
public static function gen_json($settings) { public static function gen_json($settings) {
ob_start(); ob_start();
Bans::stream_json(false, true, true, array()); Bans::stream_json(false, true, true, array(), true);
$out = ob_get_contents(); $out = ob_get_contents();
ob_end_clean(); ob_end_clean();
return $out; return $out;