]> BookStack Code Mirror - bookstack/commitdiff
Change check to verify that request is present and contains a file
authorTBK <redacted>
Tue, 3 Mar 2020 23:08:01 +0000 (00:08 +0100)
committerTBK <redacted>
Tue, 3 Mar 2020 23:17:45 +0000 (00:17 +0100)
app/Http/Controllers/SettingController.php
app/Http/Controllers/UserController.php

index 00dd60ac759b5a005522c2e7b2b504a36bfa9107..9c51ef4af2e888bfdfcbc18a9cb5a1a4c9ffd39b 100644 (file)
@@ -57,7 +57,7 @@ class SettingController extends Controller
         }
 
         // Update logo image if set
-        if ($request->has('app_logo')) {
+        if ($request->hasFile('app_logo')) {
             $logoFile = $request->file('app_logo');
             $this->imageRepo->destroyByType('system');
             $image = $this->imageRepo->saveNew($logoFile, 'system', 0, null, 86);
index 207466f388fa5e8faaecdca2838f7186d7ca7cf4..c91b7678c58a075671ad89942685a0b7bafaa470 100644 (file)
@@ -191,7 +191,7 @@ class UserController extends Controller
         }
 
         // Save profile image if in request
-        if ($request->has('profile_image')) {
+        if ($request->hasFile('profile_image')) {
             $imageUpload = $request->file('profile_image');
             $this->imageRepo->destroyImage($user->avatar);
             $image = $this->imageRepo->saveNew($imageUpload, 'user', $user->id);