Skip to content

Commit

Permalink
Merge pull request #26 from platformsh/bug/17-smtphost
Browse files Browse the repository at this point in the history
returns empty string if envPrefix+SMTP_HOST is requested via ->getValue.
  • Loading branch information
chadwcarlson authored Sep 14, 2023
2 parents 09982f2 + 645133e commit dc08f50
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,14 @@ public function hasRelationship(string $relationship) : bool
protected function getValue(string $name) : ?string
{
$checkName = $this->envPrefix . strtoupper($name);
/*
* If enable_smtp is to `false` for the project, then the envPrefix.SMTP_HOST environmental variable is not
* included in the environment. Therefore, if the environmental variable isn't set, return an empty string, not
* a null
*/
if('SMTP_HOST' === $name) {
return $this->environmentVariables[$checkName] ?? "";
}
return $this->environmentVariables[$checkName] ?? null;
}

Expand Down

0 comments on commit dc08f50

Please sign in to comment.