diff options
author | Cyrill von Wattenwyl <cvw@adfinis.com> | 2014-09-02 11:20:52 +0200 |
---|---|---|
committer | Cyrill von Wattenwyl <cvw@adfinis.com> | 2014-09-02 11:20:52 +0200 |
commit | 11a40dd1fef6c5b78b054617caba4325f95ee386 (patch) | |
tree | de2e1d7efd6423ef4d1256dd5c90a972ad172719 /program/steps/mail/attachments.inc | |
parent | 187fd666aa2f32dedfe544d69b7cb213698197f2 (diff) | |
parent | ba084313bfc9c7a5a83e0611fe4376543cc1653d (diff) |
Merge branch 'master' of https://github.com/roundcube/roundcubemail
Conflicts:
plugins/password/config.inc.php.dist
Diffstat (limited to 'program/steps/mail/attachments.inc')
-rw-r--r-- | program/steps/mail/attachments.inc | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/program/steps/mail/attachments.inc b/program/steps/mail/attachments.inc index 85bc36cac..5eaa655e3 100644 --- a/program/steps/mail/attachments.inc +++ b/program/steps/mail/attachments.inc @@ -38,7 +38,7 @@ if (!$COMPOSE) { // remove an attachment -if ($RCMAIL->action=='remove-attachment') { +if ($RCMAIL->action == 'remove-attachment') { $id = 'undefined'; if (preg_match('/^rcmfile(\w+)$/', $_POST['_file'], $regs)) { @@ -60,32 +60,14 @@ if ($RCMAIL->action=='remove-attachment') { exit; } -if ($RCMAIL->action=='display-attachment') { +if ($RCMAIL->action == 'display-attachment') { $id = 'undefined'; if (preg_match('/^rcmfile(\w+)$/', $_GET['_file'], $regs)) { $id = $regs[1]; } - if ($attachment = $COMPOSE['attachments'][$id]) { - $attachment = $RCMAIL->plugins->exec_hook('attachment_display', $attachment); - } - - if ($attachment['status']) { - if (empty($attachment['size'])) { - $attachment['size'] = $attachment['data'] ? strlen($attachment['data']) : @filesize($attachment['path']); - } - - header('Content-Type: ' . $attachment['mimetype']); - header('Content-Length: ' . $attachment['size']); - - if ($attachment['data']) { - echo $attachment['data']; - } - else if ($attachment['path']) { - readfile($attachment['path']); - } - } + $RCMAIL->display_uploaded_file($COMPOSE['attachments'][$id]); exit; } @@ -139,6 +121,7 @@ if (is_array($_FILES['_attachments']['tmp_name'])) { 'onclick' => sprintf("return %s.command('remove-attachment','rcmfile%s', this)", rcmail_output::JS_OBJECT_NAME, $id), 'title' => $RCMAIL->gettext('delete'), 'class' => 'delete', + 'aria-label' => $RCMAIL->gettext('delete') . ' ' . $attachment['name'], ), $button); $content .= rcube::Q($attachment['name']); |