summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2011-02-19 19:28:07 +1100
committerSavetheinternet <savetheinternet@n0v4.com>2011-02-19 19:28:07 +1100
commit13ef38d7b72085dbf436fa62f1b5ae76a88df3bd (patch)
tree3bd05a401bc98ccf5cafa32cd62acc90773327c1 /post.php
parent73746b7c8da6f27a503abd72c6888870a47dbde3 (diff)
Delete images properly on error
Diffstat (limited to 'post.php')
-rw-r--r--post.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/post.php b/post.php
index 71a2faae..f15545bb 100644
--- a/post.php
+++ b/post.php
@@ -247,12 +247,12 @@
// Check if the image is valid
if($post['width'] < 1 || $post['height'] < 1) {
- unlink($post['file']);
+ undoImage($post);
error($config['error']['invalidimg']);
}
if($post['width'] > $config['max_width'] || $post['height'] > $config['max_height']) {
- unlink($post['file']);
+ undoImage($post);
error($config['error']['maxsize']);
}
@@ -269,6 +269,7 @@
}
if(!($mod && $mod['type'] >= $config['mod']['postunoriginal']) && $config['robot_enable'] && checkRobot($post['body_nomarkup'])) {
+ undoImage($post);
if($config['robot_mute']) {
error(sprintf($config['error']['muted'], mute()));
} else {