Skip to content

Commit

Permalink
fix: check if defined WRITEPATH exists
Browse files Browse the repository at this point in the history
  • Loading branch information
michalsn committed Dec 11, 2024
1 parent 0b0126c commit 9d28744
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion system/Boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,13 @@ protected static function definePathConstants(Paths $paths): void

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

// The path to the tests directory
Expand Down

0 comments on commit 9d28744

Please sign in to comment.