From 1625bd68e3773e25e9b34f40cc0d5b3d0b71df1f Mon Sep 17 00:00:00 2001 From: Thomas Hori Date: Tue, 25 Apr 2017 17:48:34 +0100 Subject: [PATCH 1/2] Fix error upon bulk add. Fixes "PHP Fatal error: Uncaught TypeError: Argument 2 passed to TagSetEvent::__construct() must be of the type array, string given" upon bulk add. --- core/imageboard.pack.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/imageboard.pack.php b/core/imageboard.pack.php index 755de669..5a2dacab 100644 --- a/core/imageboard.pack.php +++ b/core/imageboard.pack.php @@ -1219,7 +1219,7 @@ function add_dir($base) { $short_path = str_replace($base, "", $full_path); $filename = basename($full_path); - $tags = path_to_tags($short_path); + $tags = Tag::explode(path_to_tags($short_path)); $result = "$short_path (".str_replace(" ", ", ", $tags).")... "; try { add_image($full_path, $filename, $tags); From d1306cfb2d0293af639f724e259866e4d613e394 Mon Sep 17 00:00:00 2001 From: Thomas Hori Date: Wed, 26 Apr 2017 14:08:06 +0100 Subject: [PATCH 2/2] Move Tag::explode call into add_image call so that $result is unaffected. --- core/imageboard.pack.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/imageboard.pack.php b/core/imageboard.pack.php index 5a2dacab..9e20b33e 100644 --- a/core/imageboard.pack.php +++ b/core/imageboard.pack.php @@ -1219,10 +1219,10 @@ function add_dir($base) { $short_path = str_replace($base, "", $full_path); $filename = basename($full_path); - $tags = Tag::explode(path_to_tags($short_path)); + $tags = path_to_tags($short_path); $result = "$short_path (".str_replace(" ", ", ", $tags).")... "; try { - add_image($full_path, $filename, $tags); + add_image($full_path, $filename, Tag::explode($tags)); $result .= "ok"; } catch(UploadException $ex) {