From: Mikael Nordfeldth Date: Mon, 9 May 2016 20:08:36 +0000 (+0200) Subject: Add /download action for attachments X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=bd306bdb9fb43e80f9092784602a9508a7d52031;p=quix0rs-gnu-social.git Add /download action for attachments --- diff --git a/actions/attachment_download.php b/actions/attachment_download.php new file mode 100644 index 0000000000..6792c45993 --- /dev/null +++ b/actions/attachment_download.php @@ -0,0 +1,20 @@ + + * @license https://www.gnu.org/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link https:/gnu.io/social + */ +class Attachment_downloadAction extends AttachmentAction +{ + public function showPage() + { + common_redirect($this->attachment->getUrl(), 302); + } +} diff --git a/lib/router.php b/lib/router.php index 5a51f3d7d4..b01c9a7677 100644 --- a/lib/router.php +++ b/lib/router.php @@ -223,6 +223,10 @@ class Router array('action' => 'attachment'), array('attachment' => '[0-9]+')); + $m->connect('attachment/:attachment/download', + array('action' => 'attachment_download'), + array('attachment' => '[0-9]+')); + $m->connect('attachment/:attachment/thumbnail', array('action' => 'attachment_thumbnail'), array('attachment' => '[0-9]+'));