Skip to content

Commit

Permalink
Merge pull request #1460 from hydephp/realtime-compiler-code-cleanup
Browse files Browse the repository at this point in the history
Minor internal realtime compiler code cleanup
  • Loading branch information
caendesilva authored Nov 13, 2023
2 parents f849313 + c151322 commit 763c08f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/realtime-compiler/src/Http/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
6 changes: 4 additions & 2 deletions packages/realtime-compiler/src/Routing/PageRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 763c08f

Please sign in to comment.