]> BookStack Code Mirror - bookstack/commitdiff
Merge branch 'patch-1' of git://github.com/younes0/BookStack into younes0-patch-1
authorDan Brown <redacted>
Sun, 10 Jul 2016 09:15:38 +0000 (10:15 +0100)
committerDan Brown <redacted>
Sun, 10 Jul 2016 09:15:38 +0000 (10:15 +0100)
1  2 
app/Services/ImageService.php

index 274172f0fa0b831bfdb7023ea938697850a82021,331a407c3daf2a24d658c0c751b38d6cfd6065b2..f645a06a5b71415622bbeff85515db2a352e5d02
@@@ -95,7 -95,6 +95,7 @@@ class ImageServic
  
          try {
              $storage->put($fullPath, $imageData);
 +            $storage->setVisibility($fullPath, 'public');
          } catch (Exception $e) {
              throw new ImageUploadException('Image Path ' . $fullPath . ' is not writable by the server.');
          }
  
          $thumbData = (string)$thumb->encode();
          $storage->put($thumbFilePath, $thumbData);
 +        $storage->setVisibility($thumbFilePath, 'public');
          $this->cache->put('images-' . $image->id . '-' . $thumbFilePath, $thumbFilePath, 60 * 72);
  
          return $this->getPublicUrl($thumbFilePath);
              // Get the standard public s3 url if s3 is set as storage type
              if ($storageUrl == false && config('filesystems.default') === 's3') {
                  $storageDetails = config('filesystems.disks.s3');
-                 $storageUrl = 'https://s3-' . $storageDetails['region'] . '.amazonaws.com/' . $storageDetails['bucket'];
+                 $storageUrl = 'https://' . $storageDetails['bucket'] . '.s3.amazonaws.com';
              }
  
              $this->storageUrl = $storageUrl;