From 78ffd76fcfbc1846ff3b355ffa35015e5f0b6642 Mon Sep 17 00:00:00 2001 From: Reid 'Crafted' Date: Tue, 13 May 2014 21:23:06 +0100 Subject: [PATCH 1/2] Make post.php compatable with PHP 5.3x Compatible with earlier versions of PHP. This should work on 5.4 too, but I haven't tested it. --- post.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/post.php b/post.php index 133ecd27..9d63d7fa 100644 --- a/post.php +++ b/post.php @@ -568,7 +568,8 @@ if (isset($_POST['delete'])) { } if ($output = shell_exec_error("cat $filenames | md5sum")) { - $hash = explode(' ', $output)[0]; + $explodedvar = explode(' ', $output); + $hash = $explodedvar[0]; $post['filehash'] = $hash; } elseif ($config['max_images'] === 1) { $post['filehash'] = md5_file($upload); From 9b3f8421fc93f74bbb6156f6963881adca28c387 Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Wed, 14 May 2014 13:51:49 -0400 Subject: [PATCH 2/2] Fix displaying bans --- inc/functions.php | 11 ++--------- templates/banned.html | 4 ++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index b8198522..9d55f2f2 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -689,22 +689,15 @@ function displayBan($ban) { } $ban['ip'] = $_SERVER['REMOTE_ADDR']; + 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 `files` FROM ``posts_%s`` WHERE `id` = " . (int)$ban['post']['id'], $board['uri'])); if ($_post = $query->fetch(PDO::FETCH_ASSOC)) { $ban['post'] = array_merge($ban['post'], $_post); - } else { - $ban['post']['file'] = 'deleted'; - $ban['post']['thumb'] = false; } - } else { - $ban['post']['file'] = 'deleted'; - $ban['post']['thumb'] = false; } - if ($ban['post']['thread']) { $post = new Post($ban['post']); } else { diff --git a/templates/banned.html b/templates/banned.html index 1a9a3915..33f9d9f8 100644 --- a/templates/banned.html +++ b/templates/banned.html @@ -83,7 +83,7 @@ {% if post and config.ban_show_post %}
-

{% trans %}You were banned for the following post on {% endtrans %}{{ board.url }}:

+

{% trans %}You were banned for the following post on{% endtrans %} {{ board.url }}:

{{ post }}
{% endif %} @@ -133,4 +133,4 @@ {% endif %} {% endif %} -{% endfilter %} \ No newline at end of file +{% endfilter %}