Fix .env migration unescaped $ in passwords (#8688)

* Fix .env migration unescaped $ in passwords
Better fix for timezone in Laravel

* Simpler change
This commit is contained in:
Tony Murray
2018-05-10 13:20:24 -05:00
committed by GitHub
parent 303336bce4
commit e0f9572582
2 changed files with 3 additions and 2 deletions

View File

@@ -136,7 +136,8 @@ class ComposerHelper
if (strpos($content, "$key=") !== false) {
// only replace ones that aren't already set for safety and uncomment
$content = preg_replace("/#?$key=\n/", "$key=$value\n", $content);
// escape $ in the replacement
$content = preg_replace("/#?$key=\n/", addcslashes("$key=$value\n", '$'), $content);
} else {
$content .= "$key=$value\n";
}