1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Fixed app logo visibility with secure_restricted images

Includes test to cover.
For #3827
This commit is contained in:
Dan Brown
2022-11-10 14:15:59 +00:00
parent 832356d56e
commit d2260b234c
2 changed files with 23 additions and 5 deletions

View File

@ -88,16 +88,17 @@ class ImageService
protected function getStorageDiskName(string $imageType): string
{
$storageType = config('filesystems.images');
$localSecureInUse = ($storageType === 'local_secure' || $storageType === 'local_secure_restricted');
// Ensure system images (App logo) are uploaded to a public space
if ($imageType === 'system' && $storageType === 'local_secure') {
$storageType = 'local';
if ($imageType === 'system' && $localSecureInUse) {
return 'local';
}
// Rename local_secure options to get our image specific storage driver which
// is scoped to the relevant image directories.
if ($storageType === 'local_secure' || $storageType === 'local_secure_restricted') {
$storageType = 'local_secure_images';
if ($localSecureInUse) {
return 'local_secure_images';
}
return $storageType;