summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorMichael Save <savetheinternet@tinyboard.org>2012-03-10 20:53:41 +1100
committerMichael Save <savetheinternet@tinyboard.org>2012-03-10 20:53:41 +1100
commitde17bdb317d4fae6d23b0313231d1383562e3ef6 (patch)
tree9093c84df6c5951c29c804a8b31dccce9bc665cf /post.php
parent306a7f0e367d9c128b345ac8336e590c0018381c (diff)
Remade config[redraw_image]
Diffstat (limited to 'post.php')
-rw-r--r--post.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/post.php b/post.php
index 36bfc4a7..adb98734 100644
--- a/post.php
+++ b/post.php
@@ -454,6 +454,9 @@
// Move the uploaded file
if(!@move_uploaded_file($_FILES['file']['tmp_name'], $post['file'])) error($config['error']['nomove']);
+ $post['filehash'] = $config['file_hash']($post['file']);
+ $post['filesize'] = filesize($post['file']);
+
if($is_an_image) {
// Check IE MIME type detection XSS exploit
$buffer = file_get_contents($post['file'], null, null, null, 255);
@@ -532,6 +535,11 @@
$thumb->_destroy();
}
+
+ if($config['redraw_image']) {
+ $image->to($post['file']);
+ }
+
$image->destroy();
} else {
// not an image
@@ -543,9 +551,6 @@
$post['thumbwidth'] = $size[0];
$post['thumbheight'] = $size[1];
}
-
- $post['filehash'] = $config['file_hash']($post['file']);
- $post['filesize'] = filesize($post['file']);
}
if($post['has_file'] && $config['image_reject_repost'] && $p = getPostByHash($post['filehash'])) {