Skip to content

Commit 81c7d26

Browse files
authored
Merge pull request #482 from hydephp/code-cleanup
Fix validation bug in rebuild command
2 parents 66956b0 + 868d477 commit 81c7d26

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

RELEASE_NOTES.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ In general, these changes should only affect those who have written custom code
3838
- Removed interface RouteFacadeContract (merged into existing RouteContract)
3939

4040
### Fixed
41-
- for any bug fixes.
41+
- Fixed validation bug in the rebuild command
4242

4343
### Security
4444
- in case of vulnerabilities.

packages/framework/src/Commands/HydeRebuildStaticSiteCommand.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ public function sanitizePathString(string $path): string
9898
public function validate(): void
9999
{
100100
if (! (
101-
str_starts_with($this->path, Hyde::pathToRelative(Hyde::getDocumentationPagePath())) ||
102-
str_starts_with($this->path, Hyde::pathToRelative(Hyde::getMarkdownPostPath())) ||
103101
str_starts_with($this->path, Hyde::pathToRelative(Hyde::getBladePagePath())) ||
104-
str_starts_with($this->path, Hyde::pathToRelative(Hyde::getMarkdownPostPath()))
102+
str_starts_with($this->path, Hyde::pathToRelative(Hyde::getMarkdownPagePath())) ||
103+
str_starts_with($this->path, Hyde::pathToRelative(Hyde::getMarkdownPostPath())) ||
104+
str_starts_with($this->path, Hyde::pathToRelative(Hyde::getDocumentationPagePath()))
105105
)) {
106106
throw new Exception("Path [$this->path] is not in a valid source directory.", 400);
107107
}

0 commit comments

Comments
 (0)