]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
[CORE] Added documentation and fixed typo in attachments action
authorMiguel Dantas <biodantasgs@gmail.com>
Mon, 15 Jul 2019 02:20:55 +0000 (03:20 +0100)
committerDiogo Cordeiro <diogo@fc.up.pt>
Sat, 3 Aug 2019 16:31:44 +0000 (17:31 +0100)
actions/attachment.php
actions/attachment_download.php
actions/attachment_thumbnail.php
actions/attachment_view.php

index 993f94b007834d5347a69904c841020e68b0dab0..ae09a7256f00740532e5217a80ac9b36731ee3a3 100644 (file)
@@ -205,6 +205,8 @@ class AttachmentAction extends ManagedAction
      * Include $filepath in the response, for viewing and downloading.
      * If provided, $filesize is used to size the HTTP request,
      * otherwise it's value is calculated
+     * @param string $filepath the absolute path to the file to send
+     * @param $filesize optional, calculated if unkown
      */
     static function sendFile(string $filepath, $filesize) {
         if (is_string(common_config('site', 'x-static-delivery'))) {
index 38ff046943ced557f05a4b1303d3fe8d8430403b..62d5b43e47913120448e70eb07d3327081d83a16 100644 (file)
@@ -21,7 +21,7 @@ class Attachment_downloadAction extends AttachmentAction
         $mimetype = $this->attachment->getFileOrThumbnailMimetype();
 
         if (empty($filepath)) {
-            $thiis->clientError(_('No such attachment'), 404);
+            $this->clientError(_('No such attachment'), 404);
         }
 
         $filename = MediaFile::getDisplayName($this->attachment);
index 2a2ce61d94ab1101e9de90f82c258da6388f7d83..a4dad03f686fea0f1ef0d42a3ff9d1c438632963 100644 (file)
@@ -53,6 +53,12 @@ class Attachment_thumbnailAction extends AttachmentAction
         $this->thumb_c = $this->boolean('c');
     }
 
+    /**
+     * Show an inline representation of an attachment of the size
+     * requested in the GET variables (read in the constructor). Tries
+     * to send the most appropriate file with the correct size and
+     * headers or displays an error if it's not possible.
+     */
     public function showPage()
     {
 
index e5f1c94da30165b9cc3fa6b6189f01fc80c0f600..cf33c6f6cf8cf2da7d0ca2cb0fd705f042cf48c5 100644 (file)
@@ -19,7 +19,7 @@ class Attachment_viewAction extends AttachmentAction
         $mimetype = $this->attachment->getFileOrThumbnailMimetype();
 
         if (empty($filepath)) {
-            $thiis->clientError(_('No such attachment'), 404);
+            $this->clientError(_('No such attachment'), 404);
         }
 
         $filename = MediaFile::getDisplayName($this->attachment);