diff --git a/packages/realtime-compiler/src/Http/DashboardController.php b/packages/realtime-compiler/src/Http/DashboardController.php index 971b8a21824..f7d22f2afb9 100644 --- a/packages/realtime-compiler/src/Http/DashboardController.php +++ b/packages/realtime-compiler/src/Http/DashboardController.php @@ -99,21 +99,14 @@ protected function show(): string protected function handlePostRequest(): JsonResponse { - $actions = array_combine($actions = [ - 'openInExplorer', - 'openPageInEditor', - 'openMediaFileInEditor', - 'createPage', - ], $actions); - $action = $this->request->data['action'] ?? $this->abort(400, 'Must provide action'); - $action = $actions[$action] ?? $this->abort(403, "Invalid action '$action'"); match ($action) { 'openInExplorer' => $this->openInExplorer(), 'openPageInEditor' => $this->openPageInEditor(), 'openMediaFileInEditor' => $this->openMediaFileInEditor(), 'createPage' => $this->createPage(), + default => $this->abort(403, "Invalid action '$action'"), }; return $this->response ?? new JsonResponse(200, 'OK', [