]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/mediafile.php
No more needed (for this fix) but maybe later. So I always only comment them out.
[quix0rs-gnu-social.git] / lib / mediafile.php
index 4ac33ab7e1def91bfbfbb3b42a00173f656f9668..3bbbd162f0c18985d7cfc6238ab2b2d39854d8a5 100644 (file)
@@ -79,6 +79,15 @@ class MediaFile
         @unlink($filepath);
     }
 
+    public function getFile()
+    {
+        if (!$this->fileRecord instanceof File) {
+            throw new ServerException('File record did not exist for MediaFile');
+        }
+
+        return $this->fileRecord;
+    }
+
     protected function storeFile()
     {
 
@@ -177,7 +186,7 @@ class MediaFile
                             ' partially uploaded.'));
             case UPLOAD_ERR_NO_FILE:
                 // No file; probably just a non-AJAX submission.
-                return;
+                throw new NoUploadedMediaException($param);
             case UPLOAD_ERR_NO_TMP_DIR:
                 // TRANS: Client exception thrown when a temporary folder is not present to store a file upload.
                 throw new ClientException(_('Missing a temporary folder.'));