]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
File_thumbnail->getUrl now gives Attachment_thumbnail action URL
authorMikael Nordfeldth <mmn@hethane.se>
Fri, 3 Apr 2015 19:21:39 +0000 (21:21 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Fri, 3 Apr 2015 19:21:39 +0000 (21:21 +0200)
That in turn redirects to the statically stored file.

actions/attachment_thumbnail.php
classes/File_thumbnail.php

index c85029dcf609e871a57b4c5d72bfcc929b4e4284..e8f89ffc360d45c505aefd5198e4927e9b04a8ec 100644 (file)
@@ -62,6 +62,6 @@ class Attachment_thumbnailAction extends AttachmentAction
             common_redirect($e->file->getUrl());
         }
 
-        common_redirect($thumbnail->getUrl());
+        common_redirect(File_thumbnail::url($thumbnail->filename));
     }
 }
index 4c44e10fc1435f9afe725ca115394d48c55ecf20..1250f70404481062e3492da8b37748789a0f521a 100644 (file)
@@ -142,7 +142,11 @@ class File_thumbnail extends Managed_DataObject
                 $this->url = null;
                 $this->update($orig);
             }
-            return self::url($this->filename);
+            $url = common_local_url('attachment_thumbnail', array('attachment'=>$this->file_id));
+            if (strpos($url, '?') === false) {
+                $url .= '?';
+            }
+            return $url . http_build_query(array('w'=>$this->width, 'h'=>$this->height));
         }
 
         // No local filename available, return the URL we have stored