Skip to content

Commit c4e9f2a

Browse files
committed
CHG trims file contents from secrets, prevents uninented whitespaces
1 parent 847f9e4 commit c4e9f2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ConnectParams.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(
4141
public static function fromEnv(string $alias)
4242
{
4343
$alias = strtoupper($alias);
44-
44+
4545
$driverKey = "DATABASE_{$alias}_DRIVER";
4646
$driverVal = static::getenv($driverKey);
4747
if (empty($driverVal)) {
@@ -70,7 +70,7 @@ public static function fromEnv(string $alias)
7070

7171
$pswd = static::getenv($pswdKey) ?? $driver->getDefaultPswd();
7272
if (!empty(static::getenv($pwflKey)) && file_exists(static::getenv($pwflKey))) {
73-
$pswd = file_get_contents(static::getenv($pwflKey));
73+
$pswd = trim(file_get_contents(static::getenv($pwflKey)));
7474
}
7575

7676
return new ConnectParams($driver, $host, $user, $pswd, $name, $port, $encd, $inst);

0 commit comments

Comments
 (0)