Fix permission of temporary files and removal of them when generating thumbnails

pull/191/merge
Aleksander Machniak 7 years ago
parent 306c901a15
commit 5a53d521c8

@ -87,7 +87,6 @@ if (!empty($_GET['_thumb']) && $attachment->is_valid()) {
if ($imgtype = $image->resize($thumbnail_size, $cache_file, true)) {
$mimetype = 'image/' . $imgtype;
unlink($orig_name);
}
else {
// Resize failed, we need to check the file mimetype
@ -95,6 +94,8 @@ if (!empty($_GET['_thumb']) && $attachment->is_valid()) {
$_GET['_thumb'] = 0;
$_REQUEST['_embed'] = 1;
}
unlink($orig_name);
}
if (!empty($_GET['_thumb'])) {
@ -598,6 +599,7 @@ class rcmail_attachment_handler
$this->body(0, $fp);
$this->body_file = $filename;
fclose($fp);
@chmod(filename, 0600);
return true;
}

Loading…
Cancel
Save