diff --git a/packages/realtime-compiler/src/Http/BaseController.php b/packages/realtime-compiler/src/Http/BaseController.php index 385e2d534a4..991c8f694bb 100644 --- a/packages/realtime-compiler/src/Http/BaseController.php +++ b/packages/realtime-compiler/src/Http/BaseController.php @@ -86,7 +86,7 @@ protected function isRequestMadeFromLocalhost(): bool return in_array($requestIp, $allowedIps, true); } - protected function generateCSRFToken(): string + protected static function generateCSRFToken(): string { if (empty($_SESSION['csrf_token'])) { $_SESSION['csrf_token'] = bin2hex(random_bytes(32)); diff --git a/packages/realtime-compiler/src/Routing/PageRouter.php b/packages/realtime-compiler/src/Routing/PageRouter.php index a7754cc19be..9981e9a6651 100644 --- a/packages/realtime-compiler/src/Routing/PageRouter.php +++ b/packages/realtime-compiler/src/Routing/PageRouter.php @@ -63,12 +63,14 @@ protected function getHtml(HydePage $page): string } if (config('hyde.server.save_preview')) { - return file_get_contents(StaticPageBuilder::handle($page)); + $contents = file_get_contents(StaticPageBuilder::handle($page)); } else { Hyde::shareViewData($page); - return $page->compile(); + $contents = $page->compile(); } + + return $contents; } public static function handle(Request $request): Response