From 510d0e80ac2a5845badb37024991d1f58c605638 Mon Sep 17 00:00:00 2001 From: Josef Citrine Date: Wed, 21 Dec 2016 03:05:58 +0000 Subject: [PATCH] Simplified playlist 404 if statement --- app/Http/Controllers/PlaylistsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/PlaylistsController.php b/app/Http/Controllers/PlaylistsController.php index cd83b145..20b64ecc 100644 --- a/app/Http/Controllers/PlaylistsController.php +++ b/app/Http/Controllers/PlaylistsController.php @@ -63,7 +63,7 @@ class PlaylistsController extends Controller public function getDownload($id, $extension) { $playlist = Playlist::with('tracks', 'tracks.trackFiles', 'user', 'tracks.album')->find($id); - if (!$playlist || (!$playlist->is_public && !Auth::check()) || !$playlist->canView(Auth::user()) || (!$playlist->is_public && ($playlist->user_id !== Auth::user()->id))) { + if (!$playlist || !$playlist->canView(Auth::user())) { App::abort(404); }