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

Fix double escaping of the decision attributes in the profiler#21387

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
nicolas-grekas merged 1 commit intosymfony:3.2fromstof:fix_double_escaping
Jan 24, 2017

Conversation

@stof
Copy link
Member

QA
Branch?3.2
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#21384
LicenseMIT
Doc PRn/a

A ternary operator is considered safe by the Twig auto-escaping only when both branches are safe. But this ternary was safe only in the ELSE branch, causing it to be unsafe. This triggered a double-escaping of the value (escaping the output of the dump). The fix is to use a {% if %} and 2 separate output statements, allowing them to be auto-escaped separately.

linaori reacted with thumbs up emoji
A ternary operator is considered safe by the Twig auto-escaping only whenboth branches are safe. But this ternary was safe only in the ELSE branch,causing it to be unsafe. This triggered a double-escaping of the value(escaping the output of the dump). The fix is to use a {% if %} and 2 separateoutput statements, allowing them to be auto-escaped separately.
@stof
Copy link
MemberAuthor

Note that 3.1 is not affected, becauseprofiler_dump is not safe there

@linaori
Copy link
Contributor

Okay, I have to admit, I would not have guessed this was even possible 😆

@stofstof changed the base branch frommaster to3.2January 24, 2017 09:52
@nicolas-grekasnicolas-grekas added this to the3.2 milestoneJan 24, 2017
@nicolas-grekas
Copy link
Member

Good catch, thanks@stof.

@nicolas-grekasnicolas-grekas merged commitbc1f084 intosymfony:3.2Jan 24, 2017
nicolas-grekas added a commit that referenced this pull requestJan 24, 2017
…iler (stof)This PR was merged into the 3.2 branch.Discussion----------Fix double escaping of the decision attributes in the profiler| Q             | A| ------------- | ---| Branch?       | 3.2| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#21384| License       | MIT| Doc PR        | n/aA ternary operator is considered safe by the Twig auto-escaping only when both branches are safe. But this ternary was safe only in the ELSE branch, causing it to be unsafe. This triggered a double-escaping of the value (escaping the output of the dump). The fix is to use a {% if %} and 2 separate output statements, allowing them to be auto-escaped separately.Commits-------bc1f084 Fix double escaping of the decision attributes in the profiler
@stofstof deleted the fix_double_escaping branchJanuary 24, 2017 10:25
@javiereguiluz
Copy link
Member

@stof super nice catch! Thanks for the fix and the explanation.

@fabpotfabpot mentioned this pull requestFeb 6, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

3.2

Development

Successfully merging this pull request may close these issues.

5 participants

@stof@linaori@nicolas-grekas@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp