Browse Source

Don't include post messages in public banlist

pull/40/head
Michael Walker 9 years ago
parent
commit
692ca79d8b
  1. 4
      inc/bans.php
  2. 2
      templates/themes/public_banlist/theme.php

4
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;
}

2
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;

Loading…
Cancel
Save