summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--post.php6
1 files changed, 5 insertions, 1 deletions
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);
}