diff --git a/.php_cs b/.php_cs index c2bbfe8c6..c854af47c 100644 --- a/.php_cs +++ b/.php_cs @@ -51,5 +51,5 @@ return PhpCsFixer\Config::create() 'equal' => false, 'identical' => false, 'less_and_greater' => false, - ] + ], ])->setRiskyAllowed(true)->setFinder($finder); diff --git a/app/Http/Controllers/Server/Tasks/TaskManagementController.php b/app/Http/Controllers/Server/Tasks/TaskManagementController.php index e61a560fa..9e6782e93 100644 --- a/app/Http/Controllers/Server/Tasks/TaskManagementController.php +++ b/app/Http/Controllers/Server/Tasks/TaskManagementController.php @@ -149,8 +149,6 @@ class TaskManagementController extends Controller * * @param \Pterodactyl\Http\Requests\Server\ScheduleCreationFormRequest $request * @return \Illuminate\Http\RedirectResponse - * - * @throws \Illuminate\Auth\Access\AuthorizationException */ public function update(ScheduleCreationFormRequest $request): RedirectResponse { @@ -177,7 +175,7 @@ class TaskManagementController extends Controller */ public function delete(Request $request): Response { - $server = $request->attributes->get('server_data.model'); + $server = $request->attributes->get('server'); $schedule = $request->attributes->get('schedule'); $this->authorize('delete-schedule', $server); diff --git a/app/Http/Middleware/Server/ScheduleBelongsToServer.php b/app/Http/Middleware/Server/ScheduleBelongsToServer.php index f9f40bf3b..26da5f843 100644 --- a/app/Http/Middleware/Server/ScheduleBelongsToServer.php +++ b/app/Http/Middleware/Server/ScheduleBelongsToServer.php @@ -49,7 +49,7 @@ class ScheduleBelongsToServer $scheduleId = $this->hashids->decodeFirst($request->route()->parameter('schedule'), 0); $schedule = $this->repository->getScheduleWithTasks($scheduleId); - if (object_get($schedule, 'server_id') !== $server->id) { + if ($schedule->server_id !== $server->id) { throw new NotFoundHttpException; }