Skip to content

Commit b7fc928

Browse files
committed
Document why we must validate file existence
See #1932 (comment)
1 parent d0212c1 commit b7fc928

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/framework/src/Support/Filesystem/MediaFile.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ protected function getNormalizedPath(string $path): string
172172
// Normalize the path to include the media directory
173173
$path = static::sourcePath(trim_slashes(Str::after($path, Hyde::getMediaDirectory())));
174174

175+
// Since assets need to exist on disk in order to be copied to the built site files we validate that the file is real here.
175176
if (Filesystem::missing($path)) {
176177
throw new FileNotFoundException($path);
177178
}

0 commit comments

Comments
 (0)