]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/attachment_thumbnail.php
Merge branch 'fixes/private_scope_on_tags' into social-master
[quix0rs-gnu-social.git] / actions / attachment_thumbnail.php
index b71ea6c801ce4c488c705d5cc630afb36e549653..c85029dcf609e871a57b4c5d72bfcc929b4e4284 100644 (file)
@@ -44,26 +44,24 @@ class Attachment_thumbnailAction extends AttachmentAction
     protected $thumb_h = null;  // max height
     protected $thumb_c = null;  // crop?
 
-    protected function prepare(array $args=array())
+    protected function doPreparation()
     {
-        parent::prepare($args);
+        parent::doPreparation();
 
         $this->thumb_w = $this->int('w');
         $this->thumb_h = $this->int('h');
         $this->thumb_c = $this->boolean('c');
-
-        return true;
     }
 
-    function showPage()
+    public function showPage()
     {
         // Returns a File_thumbnail object or throws exception if not available
         try {
             $thumbnail = $this->attachment->getThumbnail($this->thumb_w, $this->thumb_h, $this->thumb_c);
         } catch (UseFileAsThumbnailException $e) {
-            // Since we're only using the ->getUrl() function, we can use the File object
-            $thumbnail = $e->file;
+            common_redirect($e->file->getUrl());
         }
+
         common_redirect($thumbnail->getUrl());
     }
 }