@@ -81,14 +81,14 @@ discard block |
||
| 81 | 81 | if ($this->request->method === 'POST') { |
| 82 | 82 | $this->isAsync = (getallheaders()['X-RC-Handler'] ?? getallheaders()['x-rc-handler'] ?? null) === 'Async'; |
| 83 | 83 | |
| 84 | - if (! $this->isInteractive()) { |
|
| 84 | + if (!$this->isInteractive()) { |
|
| 85 | 85 | $this->abort(403, 'Enable `server.editor` in `config/hyde.php` to use interactive dashboard features.'); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | try { |
| 89 | 89 | $this->handlePostRequest(); |
| 90 | 90 | } catch (HttpException $exception) { |
| 91 | - if (! $this->isAsync) { |
|
| 91 | + if (!$this->isAsync) { |
|
| 92 | 92 | throw $exception; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | return new HtmlString(substr($contents, 0, 800)); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - $highlighted = str($contents)->explode("\n")->slice(0, 25)->map(function (string $line): string { |
|
| 189 | + $highlighted = str($contents)->explode("\n")->slice(0, 25)->map(function(string $line): string { |
|
| 190 | 190 | $line = rtrim($line); |
| 191 | 191 | |
| 192 | 192 | if (str_starts_with($line, '//')) { |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | $binary = $this->findGeneralOpenBinary(); |
| 316 | 316 | $path = Hyde::path($page->getSourcePath()); |
| 317 | 317 | |
| 318 | - if (! (str_ends_with($path, '.md') || str_ends_with($path, '.blade.php'))) { |
|
| 318 | + if (!(str_ends_with($path, '.md') || str_ends_with($path, '.blade.php'))) { |
|
| 319 | 319 | $this->abort(403, sprintf("Refusing to open unsafe file '%s'", basename($path))); |
| 320 | 320 | } |
| 321 | 321 | |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | $binary = $this->findGeneralOpenBinary(); |
| 330 | 330 | $path = $file->getAbsolutePath(); |
| 331 | 331 | |
| 332 | - if (! in_array($file->getExtension(), ['png', 'svg', 'jpg', 'jpeg', 'gif', 'ico', 'css', 'js'])) { |
|
| 332 | + if (!in_array($file->getExtension(), ['png', 'svg', 'jpg', 'jpeg', 'gif', 'ico', 'css', 'js'])) { |
|
| 333 | 333 | $this->abort(403, sprintf("Refusing to open unsafe file '%s'", basename($path))); |
| 334 | 334 | } |
| 335 | 335 | |