summaryrefslogtreecommitdiff
path: root/inc/mod/pages.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2014-06-16 11:39:56 +0200
committerczaks <marcin@6irc.net>2014-06-16 11:39:56 +0200
commit2c883fda0a25aaef801e6e1a6274d1912ac8cbab (patch)
treea515f4fb0a0e3b9e2ae9de74fd54561629d4c8ae /inc/mod/pages.php
parent8a189e2380829aa952d9edae5a2e3e2dc5b7ccff (diff)
fix ban appeals; thanks to sraczynski for reporting
Diffstat (limited to 'inc/mod/pages.php')
-rw-r--r--inc/mod/pages.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index 71750bdb..9b9d3127 100644
--- a/inc/mod/pages.php
+++ b/inc/mod/pages.php
@@ -962,17 +962,22 @@ function mod_ban_appeals() {
if ($ban['post'] && isset($ban['post']['board'], $ban['post']['id'])) {
if (openBoard($ban['post']['board'])) {
- $query = query(sprintf("SELECT `thumb`, `file` FROM ``posts_%s`` WHERE `id` = " .
+ $query = query(sprintf("SELECT `num_files`, `files` FROM ``posts_%s`` WHERE `id` = " .
(int)$ban['post']['id'], $board['uri']));
if ($_post = $query->fetch(PDO::FETCH_ASSOC)) {
+ $_post['files'] = $_post['files'] ? json_decode($_post['files']) : array();
$ban['post'] = array_merge($ban['post'], $_post);
} else {
- $ban['post']['file'] = 'deleted';
- $ban['post']['thumb'] = false;
+ $ban['post']['files'] = array(array());
+ $ban['post']['files'][0]['file'] = 'deleted';
+ $ban['post']['files'][0]['thumb'] = false;
+ $ban['post']['num_files'] = 1;
}
} else {
- $ban['post']['file'] = 'deleted';
- $ban['post']['thumb'] = false;
+ $ban['post']['files'] = array(array());
+ $ban['post']['files'][0]['file'] = 'deleted';
+ $ban['post']['files'][0]['thumb'] = false;
+ $ban['post']['num_files'] = 1;
}
if ($ban['post']['thread']) {