Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Dotenv] properly parse backslashes in unquoted env vars#29222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:3.4fromxabbuh:issue-29202
Nov 24, 2018

Conversation

@xabbuh
Copy link
Member

QA
Branch?3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#29202
LicenseMIT
Doc PR

++$this->cursor;
}
$value =rtrim($value);
$value =str_replace('\\\\','\\',rtrim($value));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Not sure that's enough: egFOO=A\\$B should resolve toA\Foo whenB=Foo is set previoulsy.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

you are right, and this also didn't work with double-quoted strings, both cases should be good now


$regex ='/
(\\\\)? # escaped with a backslash?
((?:\\\\)?\\\\)? # escaped with a backslash?
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thinking more about it this will probably not be enough as there could be an endless number of backslashes and we need to check whether we have an even or an odd number of them to decide whether or not the$ character is escaped.

@xabbuhxabbuhforce-pushed theissue-29202 branch 2 times, most recently fromcd30eb9 tod418826CompareNovember 14, 2018 19:06
Copy link
Contributor

@OskarStarkOskarStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Great work 👌🏻

@fabpot
Copy link
Member

Thank you@xabbuh.

@fabpotfabpot merged commit785fff5 intosymfony:3.4Nov 24, 2018
fabpot added a commit that referenced this pull requestNov 24, 2018
…xabbuh)This PR was merged into the 3.4 branch.Discussion----------[Dotenv] properly parse backslashes in unquoted env vars| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#29202| License       | MIT| Doc PR        |Commits-------785fff5 properly parse backslashes in unquoted env vars
@xabbuhxabbuh deleted the issue-29202 branchNovember 24, 2018 09:16
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@fabpotfabpotfabpot approved these changes

@OskarStarkOskarStarkOskarStark approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

5 participants

@xabbuh@fabpot@nicolas-grekas@OskarStark@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp