]> BookStack Code Mirror - bookstack/blobdiff - app/Uploads/AttachmentService.php
Guest create page: name field autofocus
[bookstack] / app / Uploads / AttachmentService.php
index ec02182bb118624fda0be7cdabbf7fde5eecadab..88bb41efb0bcc614eaafa22ac421733446484383 100644 (file)
@@ -41,7 +41,7 @@ class AttachmentService
 
         // Change to our secure-attachment disk if any of the local options
         // are used to prevent escaping that location.
-        if ($storageType === 'local' || $storageType === 'local_secure') {
+        if ($storageType === 'local' || $storageType === 'local_secure' || $storageType === 'local_secure_restricted') {
             $storageType = 'local_secure_attachments';
         }
 
@@ -64,24 +64,14 @@ class AttachmentService
     }
 
     /**
-     * Get an attachment from storage.
+     * Stream an attachment from storage.
      *
      * @throws FileNotFoundException
-     */
-    public function getAttachmentFromStorage(Attachment $attachment): string
-    {
-        return $this->getStorageDisk()->get($this->adjustPathForStorageDisk($attachment->path));
-    }
-
-    /**
-     * Stream an attachment from storage.
      *
      * @return resource|null
-     * @throws FileNotFoundException
      */
     public function streamAttachmentFromStorage(Attachment $attachment)
     {
-
         return $this->getStorageDisk()->readStream($this->adjustPathForStorageDisk($attachment->path));
     }