Skip to content

Return null for missing env vars#14253

Merged
brandonkelly merged 3 commits into5.0from
feature/cms-1249-craftparseenv-should-return-null-for-missing-env-vars
Jan 31, 2024
Merged

Return null for missing env vars#14253
brandonkelly merged 3 commits into5.0from
feature/cms-1249-craftparseenv-should-return-null-for-missing-env-vars

Conversation

@brandonkelly
Copy link
Copy Markdown
Member

Updates craft\helpers\App::parseEnv() to start returning null when a missing environment variable name is passed in. (Previously the $ENV_VAR string would just be returned verbatim.)

This makes it possible to set config values in some environments but not others, such as a $SECRET_KEY variable that might be needed to connect to S3 locally, but not on production.

@linear
Copy link
Copy Markdown

linear Bot commented Jan 31, 2024

@brandonkelly brandonkelly merged commit 1b54032 into 5.0 Jan 31, 2024
@brandonkelly brandonkelly deleted the feature/cms-1249-craftparseenv-should-return-null-for-missing-env-vars branch January 31, 2024 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant