File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
src/Symfony/Component/Dotenv Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,10 @@ private function lexValue()
215
215
$ notQuoted = true ;
216
216
$ prevChr = $ this ->data [$ this ->cursor - 1 ];
217
217
while ($ this ->cursor < $ this ->end && "\n" !== $ this ->data [$ this ->cursor ] && !((' ' === $ prevChr || "\t" === $ prevChr ) && '# ' === $ this ->data [$ this ->cursor ])) {
218
+ if ('\\' === $ this ->data [$ this ->cursor ] && isset ($ this ->data [$ this ->cursor + 1 ]) && ('" ' === $ this ->data [$ this ->cursor + 1 ] || "' " === $ this ->data [$ this ->cursor + 1 ])) {
219
+ ++$ this ->cursor ;
220
+ }
221
+
218
222
$ value .= $ prevChr = $ this ->data [$ this ->cursor ];
219
223
++$ this ->cursor ;
220
224
}
Original file line number Diff line number Diff line change @@ -94,6 +94,9 @@ public function getEnvData()
94
94
array ('FOO=" " ' , array ('FOO ' => ' ' )),
95
95
array ('PATH="c: \\\\" ' , array ('PATH ' => 'c: \\' )),
96
96
array ("FOO= \"bar \nfoo \"" , array ('FOO ' => "bar \nfoo " )),
97
+ array ('FOO=BAR \\" ' , array ('FOO ' => 'BAR" ' )),
98
+ array ("FOO=BAR \\'BAZ " , array ('FOO ' => "BAR'BAZ " )),
99
+ array ('FOO= \\"BAR ' , array ('FOO ' => '"BAR ' )),
97
100
98
101
// concatenated values
99
102
You can’t perform that action at this time.
0 commit comments