]> BookStack Code Mirror - bookstack/blobdiff - app/Uploads/ImageService.php
Update maintenance.php
[bookstack] / app / Uploads / ImageService.php
index 63c3b31722c3cb7746f48486fffe5b9615349a8e..8eefbaf9dd3468521d388addb292c7285ffd9b16 100644 (file)
@@ -73,8 +73,7 @@ class ImageService extends UploadService
         int $resizeWidth = null,
         int $resizeHeight = null,
         bool $keepRatio = true
-    )
-    {
+    ) {
         $imageName = $uploadedFile->getClientOriginalName();
         $imageData = file_get_contents($uploadedFile->getRealPath());
 
@@ -235,7 +234,7 @@ class ImageService extends UploadService
      * @return string
      * @throws ImageUploadException
      */
-    protected function resizeImage(string $imageData, $width = 220, $height = null, $keepRatio = true)
+    protected function resizeImage(string $imageData, $width = 220, $height = null, bool $keepRatio = true)
     {
         try {
             $thumb = $this->imageTool->make($imageData);
@@ -336,6 +335,7 @@ class ImageService extends UploadService
         $image = $this->saveNewFromUrl($userAvatarUrl, 'user', $imageName);
         $image->created_by = $user->id;
         $image->updated_by = $user->id;
+        $image->uploaded_to = $user->id;
         $image->save();
 
         return $image;