mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-29 10:55:43 -05:00
fix: EnvironmentWriterTrait not allowing null values
Fixes https://github.com/pterodactyl/panel/issues/5108 Signed-off-by: Matthew Penner <me@matthewp.io>
This commit is contained in:
@@ -11,8 +11,12 @@ trait EnvironmentWriterTrait
|
||||
* reasonably cause environment parsing issues. Those values are then wrapped
|
||||
* in quotes before being returned.
|
||||
*/
|
||||
public function escapeEnvironmentValue(string $value): string
|
||||
public function escapeEnvironmentValue(?string $value): string
|
||||
{
|
||||
if (is_null($value)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (!preg_match('/^\"(.*)\"$/', $value) && preg_match('/([^\w.\-+\/])+/', $value)) {
|
||||
return sprintf('"%s"', addslashes($value));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user