Skip to content

Commit 8dec674

Browse files
committed
Merge branch 'master' into release
2 parents f784c03 + e87db96 commit 8dec674

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

app/Services/ImageService.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use BookStack\Exceptions\ImageUploadException;
44
use BookStack\Image;
55
use BookStack\User;
6+
use Exception;
67
use Intervention\Image\ImageManager;
78
use Illuminate\Contracts\Filesystem\Factory as FileSystem;
89
use Illuminate\Contracts\Filesystem\Filesystem as FileSystemInstance;
@@ -88,9 +89,11 @@ private function saveNew($imageName, $imageData, $type)
8889
}
8990
$fullPath = $imagePath . $imageName;
9091

91-
if(!is_writable(dirname(public_path($fullPath)))) throw new ImageUploadException('Image Directory ' . public_path($fullPath) . ' is not writable by the server.');
92-
93-
$storage->put($fullPath, $imageData);
92+
try {
93+
$storage->put($fullPath, $imageData);
94+
} catch (Exception $e) {
95+
throw new ImageUploadException('Image Path ' . $fullPath . ' is not writable by the server.');
96+
}
9497

9598
$imageDetails = [
9699
'name' => $imageName,

readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ git clone https://github.com/ssddanbrown/BookStack.git --branch release --single
4747

4848
2. `cd` into the application folder and run `composer install`.
4949
3. Copy the `.env.example` file to `.env` and fill with your own database and mail details.
50-
4. Ensure the `storage` & `bootstrap/cache` folders are writable by the web server.
50+
4. Ensure the `storage`, `bootstrap/cache` & `public/uploads` folders are writable by the web server.
5151
5. In the application root, Run `php artisan key:generate` to generate a unique application key.
5252
6. If not using apache or if `.htaccess` files are disabled you will have to create some URL rewrite rules as shown below.
5353
7. Run `php artisan migrate` to update the database.

0 commit comments

Comments
 (0)