diff options
| author | Fredrick Brennan <admin@8chan.co> | 2014-04-29 15:20:42 -0400 |
|---|---|---|
| committer | Fredrick Brennan <admin@8chan.co> | 2014-04-29 15:20:42 -0400 |
| commit | 8e81c8c6690c1b15e4b7d2b29a51829b6b0611da (patch) | |
| tree | 6f3e1f26c55377d9f5ff81ac6a90601cb01fbab2 /post.php | |
| parent | 0557c218457425e9f05cb11dc011851b50dae0a4 (diff) | |
| parent | a2d62ce96d1446c1314cf81591c896c295cfd881 (diff) | |
Merge branch 'staging' of https://github.com/vichan-devel/vichan into staging
Diffstat (limited to 'post.php')
| -rw-r--r-- | post.php | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -320,6 +320,7 @@ if (isset($_POST['delete'])) { $_FILES['file'] = array( 'name' => basename($url_without_params), 'tmp_name' => $post['file_tmp'], + 'file_tmp' => true, 'error' => 0, 'size' => filesize($post['file_tmp']) ); @@ -704,7 +705,7 @@ if (isset($_POST['delete'])) { chmod($file['file'], 0644); } elseif (!@move_uploaded_file($file['tmp_name'], $file['file'])) error($config['error']['nomove']); - } + } } if ($config['image_reject_repost']) { @@ -757,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); } |
