summaryrefslogtreecommitdiff
path: root/program/steps/mail/func.inc
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-12-28 15:33:48 +0100
committerAleksander Machniak <alec@alec.pl>2012-12-28 15:33:48 +0100
commit830fd2ecbb67c395617e1cc38f343d12af0a2861 (patch)
tree705d0a6aefadb843f1244cbc2e8c7f39d40061a4 /program/steps/mail/func.inc
parentbe72fb3597c21ca3aaa058adf41bb72d53d197c7 (diff)
Display PGP/MIME signature attachments as "Digital Signature" (#1488570)
Diffstat (limited to 'program/steps/mail/func.inc')
-rw-r--r--program/steps/mail/func.inc9
1 files changed, 8 insertions, 1 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index bedd3e8ea..44a1557c3 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -1838,7 +1838,7 @@ function rcmail_fix_mimetype($name)
}
// return attachment filename, handle empty filename case
-function rcmail_attachment_name($attachment)
+function rcmail_attachment_name($attachment, $display = false)
{
$filename = $attachment->filename;
@@ -1858,6 +1858,13 @@ function rcmail_attachment_name($attachment)
$filename = preg_replace('[\r\n]', '', $filename);
+ // Display smart names for some known mimetypes
+ if ($display) {
+ if (preg_match('/application\/(pgp|pkcs7)-signature/i', $attachment->mimetype)) {
+ $filename = rcube_label('digitalsig');
+ }
+ }
+
return $filename;
}