123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- defined('GNUSOCIAL') || die();
- class Attachment_viewAction extends AttachmentAction
- {
- public function showPage(): void
- {
-
-
-
- @ini_set('display_errors', 0);
- if ($this->attachment->isLocal()) {
- $disposition = 'attachment';
- if (in_array(common_get_mime_media($this->mimetype), ['image', 'video'])) {
- $disposition = 'inline';
- }
- common_send_file($this->filepath, $this->mimetype,
- $this->filename, $disposition);
- } else {
- common_redirect($this->attachment->getUrl(), 303);
- }
- }
- }
|