Skip to content

Commit dc08f50

Browse files
authored
Merge pull request #26 from platformsh/bug/17-smtphost
returns empty string if envPrefix+SMTP_HOST is requested via ->getValue.
2 parents 09982f2 + 645133e commit dc08f50

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Config.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,14 @@ public function hasRelationship(string $relationship) : bool
508508
protected function getValue(string $name) : ?string
509509
{
510510
$checkName = $this->envPrefix . strtoupper($name);
511+
/*
512+
* If enable_smtp is to `false` for the project, then the envPrefix.SMTP_HOST environmental variable is not
513+
* included in the environment. Therefore, if the environmental variable isn't set, return an empty string, not
514+
* a null
515+
*/
516+
if('SMTP_HOST' === $name) {
517+
return $this->environmentVariables[$checkName] ?? "";
518+
}
511519
return $this->environmentVariables[$checkName] ?? null;
512520
}
513521

0 commit comments

Comments
 (0)