From 9416587d40452b385f46d61c6479fd6b3f6af4d8 Mon Sep 17 00:00:00 2001 From: czaks Date: Fri, 2 May 2014 18:58:21 +0200 Subject: fix a bug with multiple images; thanks to saiko of tahta.ch for reporting it --- inc/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/functions.php') diff --git a/inc/functions.php b/inc/functions.php index 041e3733..6963f9e6 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2074,8 +2074,8 @@ function buildThread50($id, $return = false, $mod = false, $thread = null, $anti foreach ($allPosts as $index => $post) { if ($index == count($allPosts)-count($thread->posts)) break; - if ($post->file) - $thread->omitted_images++; + if ($post->files) + $thread->omitted_images += count(json_decode($post->files)); } } -- cgit v1.3 From 211c1acec935357620aa9009c7ec3f23f1af368d Mon Sep 17 00:00:00 2001 From: czaks Date: Fri, 2 May 2014 19:32:18 +0200 Subject: actually fix this bug --- inc/functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'inc/functions.php') diff --git a/inc/functions.php b/inc/functions.php index 6963f9e6..a3fd288d 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2041,8 +2041,8 @@ function buildThread50($id, $return = false, $mod = false, $thread = null, $anti if (!isset($thread)) { $thread = new Thread($post, $mod ? '?/' : $config['root'], $mod); } else { - if ($post['file']) - $num_images++; + if ($post['files']) + $num_images += $post['num_files']; $thread->add(new Post($post, $mod ? '?/' : $config['root'], $mod)); } @@ -2075,7 +2075,7 @@ function buildThread50($id, $return = false, $mod = false, $thread = null, $anti if ($index == count($allPosts)-count($thread->posts)) break; if ($post->files) - $thread->omitted_images += count(json_decode($post->files)); + $thread->omitted_images += $post->num_files; } } -- cgit v1.3 From 8d4104feb06295af892b0a9cf13953eb5e17ba9a Mon Sep 17 00:00:00 2001 From: czaks Date: Sat, 3 May 2014 23:58:24 +0200 Subject: restore php5.3 compatibility. thx for Kihokki for reporting that --- inc/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/functions.php') diff --git a/inc/functions.php b/inc/functions.php index 820ee838..d09a3705 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -204,7 +204,7 @@ function loadConfig() { if (!isset($config['user_flag'])) $config['user_flag'] = false; if (!isset($config['user_flags'])) - $config['user_flags'] = []; + $config['user_flags'] = array(); if ($config['root_file']) { chdir($config['root_file']); -- cgit v1.3