From 8132db74e5e31701ff055fa9eaef4ee55436e8b0 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 17 Jan 2021 23:37:10 -0700 Subject: [PATCH] Update MediaController, remove deprecated endpoint --- app/Http/Controllers/MediaController.php | 35 +----------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/app/Http/Controllers/MediaController.php b/app/Http/Controllers/MediaController.php index 95c90396f..588adedbe 100644 --- a/app/Http/Controllers/MediaController.php +++ b/app/Http/Controllers/MediaController.php @@ -22,39 +22,6 @@ class MediaController extends Controller public function composeUpdate(Request $request, $id) { - $this->validate($request, [ - 'file' => function() { - return [ - 'required', - 'mimes:' . config('pixelfed.media_types'), - 'max:' . config('pixelfed.max_photo_size'), - ]; - }, - ]); - - $user = Auth::user(); - - $photo = $request->file('file'); - - $media = Media::whereUserId($user->id) - ->whereProfileId($user->profile_id) - ->whereNull('status_id') - ->findOrFail($id); - - $media->version = 2; - $media->save(); - - $fragments = explode('/', $media->media_path); - $name = last($fragments); - array_pop($fragments); - $dir = implode('/', $fragments); - $path = $photo->storeAs($dir, $name); - $res = []; - $res['url'] = URL::temporarySignedRoute( - 'temp-media', now()->addHours(1), ['profileId' => $media->profile_id, 'mediaId' => $media->id, 'timestamp' => time()] - ); - ImageOptimize::dispatch($media); - return $res; - + abort(404); } }