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

[Console] Escape question text and default value in SymfonyStyle::ask()#19961

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

Conversation

@chalasr
Copy link
Member

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

ogizanagi, ro0NL, and javiereguiluz reacted with thumbs up emoji
@chalasrchalasrforce-pushed theconsole/style/escape_default_value branch fromad76f98 to84779a1CompareSeptember 18, 2016 13:48
@chalasrchalasr changed the title[Console] Escape default value in SymfonyStyle::ask()[Console] Escape question text and default value in SymfonyStyle::ask()Sep 18, 2016
@ro0NL
Copy link
Contributor

ro0NL commentedSep 18, 2016
edited
Loading

This needs to be done on a per case basis? Ie.case $question instanceof ChoiceQuestion: requires a different approach right?

edit: considerhttps://github.com/chalasr/symfony/blob/84779a1b4cde11a83ec6c542ccad2e419d4e3c47/src/Symfony/Component/Console/Question/Question.php#L55 vs.https://github.com/chalasr/symfony/blob/84779a1b4cde11a83ec6c542ccad2e419d4e3c47/src/Symfony/Component/Console/Formatter/OutputFormatter.php#L28

sstok and chalasr reacted with thumbs up emoji

$text =OutputFormatter::escape($question->getQuestion());
$default =$question->getDefault();

if (null !==$default) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs to be skipped forConfirmationQuestion, else bool is converted to a string.

chalasr reacted with thumbs up emoji
@chalasrchalasrforce-pushed theconsole/style/escape_default_value branch 2 times, most recently fromd3c1d69 tof37bbbdCompareSeptember 18, 2016 14:38
@chalasr
Copy link
MemberAuthor

I made the change, refactoring a bit btw so we stop duplications.
If it looks less readable, please say me so I rollback and do the change for each case of the switch that need it.

@ro0NL
Copy link
Contributor

Yeah.. i would say revert and escape where needed.

@chalasrchalasrforce-pushed theconsole/style/escape_default_value branch fromf37bbbd toeed3cc5CompareSeptember 18, 2016 15:48
@chalasr
Copy link
MemberAuthor

Reverted.

@fabpot
Copy link
Member

Thank you@chalasr.

@fabpotfabpot merged commiteed3cc5 intosymfony:2.7Oct 5, 2016
fabpot added a commit that referenced this pull requestOct 5, 2016
…yStyle::ask() (chalasr)This PR was merged into the 2.7 branch.Discussion----------[Console] Escape question text and default value in SymfonyStyle::ask()| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#19493| License       | MIT| Doc PR        | n/aCommits-------eed3cc5 [Console] Escape default value and question in SymfonyStyle::ask()
@chalasrchalasr deleted the console/style/escape_default_value branchOctober 5, 2016 07:10
This was referencedOct 27, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@sstoksstoksstok requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@chalasr@ro0NL@fabpot@sstok@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp