mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-30 12:38:12 +08:00
Added ability to secure images behind auth
Still in testing. Adds STORAGE_TYPE=local_secure option for setting images to be behind auth. Stores images alongside attachments in /storage/uploads/images.
This commit is contained in:
@ -183,7 +183,6 @@ class ImageRepo
|
||||
* Get the thumbnail for an image.
|
||||
* If $keepRatio is true only the width will be used.
|
||||
* Checks the cache then storage to avoid creating / accessing the filesystem on every check.
|
||||
*
|
||||
* @param Image $image
|
||||
* @param int $width
|
||||
* @param int $height
|
||||
@ -194,9 +193,9 @@ class ImageRepo
|
||||
{
|
||||
try {
|
||||
return $this->imageService->getThumbnail($image, $width, $height, $keepRatio);
|
||||
} catch (FileNotFoundException $exception) {
|
||||
$image->delete();
|
||||
return [];
|
||||
} catch (\Exception $exception) {
|
||||
dd($exception);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user