1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Merge pull request #665 from BookStackApp/authed_images

Adds ability to secure images behind auth
This commit is contained in:
Dan Brown
2018-01-20 14:05:03 +00:00
committed by GitHub
8 changed files with 67 additions and 45 deletions

View File

@ -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;
}
}