Skip to content

Commit 9d28744

Browse files
committed
fix: check if defined WRITEPATH exists
1 parent 0b0126c commit 9d28744

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

system/Boot.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,13 @@ protected static function definePathConstants(Paths $paths): void
196196

197197
// The path to the writable directory.
198198
if (! defined('WRITEPATH')) {
199-
define('WRITEPATH', realpath(rtrim($paths->writableDirectory, '\\/ ')) . DIRECTORY_SEPARATOR);
199+
if (($writePath = realpath(rtrim($paths->writableDirectory, '\\/ '))) === false) {
200+
header('HTTP/1.1 503 Service Unavailable.', true, 503);
201+
echo 'The WRITEPATH is not set correctly.';
202+
// EXIT_ERROR is not yet defined
203+
exit(1);
204+
}
205+
define('WRITEPATH', $writePath . DIRECTORY_SEPARATOR);
200206
}
201207

202208
// The path to the tests directory

0 commit comments

Comments
 (0)