summaryrefslogtreecommitdiff
path: root/program/steps/mail
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-04-26 14:25:17 +0200
committerAleksander Machniak <alec@alec.pl>2013-04-26 14:25:17 +0200
commitd7fcd8ce422a24f794d18e2212163690bf3ca753 (patch)
tree9e794ca68ef5c35cc937a52bb5c28aac81a6a969 /program/steps/mail
parentfbd213a5f376118d82effb816ea98f2b8538e67b (diff)
Fix possible collision in generated thumbnail cache key (#1489069)
Diffstat (limited to 'program/steps/mail')
-rw-r--r--program/steps/mail/get.inc5
1 files changed, 3 insertions, 2 deletions
diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc
index 8218aec73..bcc6f11bc 100644
--- a/program/steps/mail/get.inc
+++ b/program/steps/mail/get.inc
@@ -62,9 +62,10 @@ else if ($_GET['_thumb']) {
$thumbnail_size = $RCMAIL->config->get('image_thumbnail_size', 240);
$temp_dir = $RCMAIL->config->get('temp_dir');
list(,$ext) = explode('/', $part->mimetype);
- $cache_basename = $temp_dir . '/' . md5($MESSAGE->headers->messageID . $part->mime_id . ':' . $RCMAIL->user->ID . ':' . $thumbnail_size);
- $cache_file = $cache_basename . '.' . $ext;
$mimetype = $part->mimetype;
+ $file_ident = $MESSAGE->headers->messageID . ':' . $part->mime_id . ':' . $part->size . ':' . $part->mimetype;
+ $cache_basename = $temp_dir . '/' . md5($file_ident . ':' . $RCMAIL->user->ID . ':' . $thumbnail_size);
+ $cache_file = $cache_basename . '.' . $ext;
// render thumbnail image if not done yet
if (!is_file($cache_file)) {