]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apimediaupload.php
Merge branch 'nightly' of gitorious.org:social/mainline into nightly
[quix0rs-gnu-social.git] / actions / apimediaupload.php
index 47d9744344b2f4475bbb825107549bfe651056a9..b675478cf67dcadde4fc33e476e082c78a231493 100644 (file)
@@ -48,14 +48,11 @@ class ApiMediaUploadAction extends ApiAuthAction
      * Grab the file from the 'media' param, then store, and shorten
      *
      * @todo Upload throttle!
-     *
-     * @param array $args $_REQUEST data (unused)
-     *
      * @return void
      */
     protected function handle()
     {
-        parent::handle();
+        parent::handle($args);
 
         // Workaround for PHP returning empty $_POST and $_FILES when POST
         // length > post_max_size in php.ini
@@ -74,17 +71,8 @@ class ApiMediaUploadAction extends ApiAuthAction
 
         // we could catch "NoUploadedMediaException" as "no media uploaded", but here we _always_ want an upload
         $upload = MediaFile::fromUpload('media', $this->scoped);
-
-        // Hack to make a thumbnail before giving back a response
-        // (the file should instead actually be attached to a notice in the file_to_post table)
-        try {
-            if ($upload->fileRecord instanceof File) {
-                $upload->fileRecord->getThumbnail();
-            }
-        } catch (Exception $e) {
-            common_debug(sprintf('A hack is buggy: MediaFile fileRecord could not getThumbnail for file id==%u',
-                                 $upload->fileRecord->id));
-        }
+        
+        // Thumbnails will be generated/cached on demand when accessed (such as with /attachment/:id/thumbnail)
 
         $this->showResponse($upload);
     }