Skip to content

Commit 871ef0c

Browse files
committed
fix: EnvironmentWriterTrait not allowing null values
Fixes pterodactyl#5108 Signed-off-by: Matthew Penner <me@matthewp.io>
1 parent bc07f8e commit 871ef0c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/Traits/Commands/EnvironmentWriterTrait.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ trait EnvironmentWriterTrait
1111
* reasonably cause environment parsing issues. Those values are then wrapped
1212
* in quotes before being returned.
1313
*/
14-
public function escapeEnvironmentValue(string $value): string
14+
public function escapeEnvironmentValue(?string $value): string
1515
{
16+
if (is_null($value)) {
17+
return '';
18+
}
19+
1620
if (!preg_match('/^\"(.*)\"$/', $value) && preg_match('/([^\w.\-+\/])+/', $value)) {
1721
return sprintf('"%s"', addslashes($value));
1822
}

0 commit comments

Comments
 (0)