Skip to content

Commit

Permalink
Change loading phpdotenv from createUnsafeImmutable to createUnsafeMu…
Browse files Browse the repository at this point in the history
…table

Realistically this mainly affects values in .env (which uses putenv). Values written to $_SERVER globally (which App::env() checks) aren’t affected.
  • Loading branch information
angrybrad committed Apr 18, 2022
1 parent 88eaf1c commit e84b53e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

// Load dotenv?
if (class_exists('Dotenv\Dotenv')) {
Dotenv\Dotenv::createUnsafeImmutable(CRAFT_BASE_PATH)->safeLoad();
// By default, this will allow .env file values to override environment variables
// with matching names. Use `createUnsafeImmutable` to disable this.
Dotenv\Dotenv::createUnsafeMutable(CRAFT_BASE_PATH)->safeLoad();
}

// Define additional PHP constants
Expand Down

0 comments on commit e84b53e

Please sign in to comment.