From 46802d3f1be8eef229539b2404baa752f8f670c3 Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 29 Apr 2014 21:18:17 +0200 Subject: [PATCH] fix post event --- post.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/post.php b/post.php index 12584c51..48973b11 100644 --- a/post.php +++ b/post.php @@ -758,7 +758,11 @@ if (isset($_POST['delete'])) { } $post = (object)$post; - if ($error = event('post', $post)) { + $post->files = array_map(function($a) { return (object)$a; }, $post->files); + $error = event('post', $post); + $post->files = array_map(function($a) { return (array)$a; }, $post->files); + + if ($error) { undoImage((array)$post); error($error); }