summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2014-04-29 21:18:17 +0200
committerczaks <marcin@6irc.net>2014-04-29 21:18:17 +0200
commit46802d3f1be8eef229539b2404baa752f8f670c3 (patch)
treee852b4fd88b4fd7c38da0adb73b5a4d742cce32c /post.php
parentd57dcc5e6e786a2122c80e0e5074ab8390a73c1b (diff)
fix post event
Diffstat (limited to 'post.php')
-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);
}