From 59b426dbfb6dd83c0ddf0814f21a536ae500f3d9 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 18 Apr 2015 17:12:21 +0200 Subject: s/files:get_multipaste_history: Remove multipastes without items Signed-off-by: Florian Pritz --- application/service/files.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'application/service') diff --git a/application/service/files.php b/application/service/files.php index 15361227c..33354d456 100644 --- a/application/service/files.php +++ b/application/service/files.php @@ -66,6 +66,14 @@ class files { $multipaste_info[$item["url_id"]]["items"][$item["id"]] = array("id" => $item["id"]); } + // No idea why, but this can/could happen so be more forgiving and clean up + foreach ($multipaste_info as $key => $m) { + if (!isset($m["items"])) { + $CI->mmultipaste->delete_id($key); + unset($multipaste_info[$key]); + } + } + return $multipaste_info; } -- cgit v1.2.3-24-g4f1b