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

[Yaml] Fix error handling on ini file parsing#22105

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
xabbuh merged 1 commit intosymfony:masterfromchalasr:yaml-parse-fix
Mar 22, 2017

Conversation

@chalasr
Copy link
Member

QA
Branch?master
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRn/a

Should make travis green again on master.
/cc@xabbuh

Copy link
Member

@xabbuhxabbuh left a comment

Choose a reason for hiding this comment

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

👍

@javiereguiluz
Copy link
Member

👍

@xabbuh
Copy link
Member

Thank you@chalasr.

@xabbuhxabbuh merged commit71cec82 intosymfony:masterMar 22, 2017
xabbuh added a commit that referenced this pull requestMar 22, 2017
This PR was merged into the 3.3-dev branch.Discussion----------[Yaml] Fix error handling on ini file parsing| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | n/a| License       | MIT| Doc PR        | n/aShould make travis green again on master./cc@xabbuhCommits-------71cec82 [Yaml] Fix error handling in parser
@chalasrchalasr deleted the yaml-parse-fix branchMarch 22, 2017 12:03
@GuilhemN
Copy link
Contributor

This part of the code supports things that shouldn't be.
e.g:

"foo"bar

is not valid.

bar"foo"

is valid but should be parsed as"bar\n\"foo\"" and not"bar\nfoo.

This could be fixed by updating some things:

  • first, trim the empty lines at the beginning of the value
  • if the value begins with*,{,[,] or} throw an exception (correct reference and correct inline mappings/sequences are parsed earlier)
  • (if the value begins with&, trim it? or throw an exception as it does not really make sense?)
  • if the value begins with!, trim the tag and process the value without it
  • if the value begins with' or", pass the entire value toInline::parse() but trim the last lines if they are empty.
  • otherwise, if the value is not special, threat the value "manually":
foreach ($linesas$line) {if ($this->preg_match('/[ \t]+#/',$line,$match,PREG_OFFSET_CAPTURE)) {$line =substr($line,0,$match[0][1]);    }if ('' ===trim($line)) {$value .="\n";$previousLineWasNewline =true;    }elseif ($previousLineWasNewline) {$value .=trim($line);$previousLineWasNewline =false;    }else {$value .=''.trim($line);$previousLineWasNewline =false;    }}

fabpot added a commit that referenced this pull requestMay 24, 2017
This PR was merged into the 3.3 branch.Discussion----------[Yaml] fix multiline block handling| Q             | A| ------------- | ---| Branch?       | 3.3| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#21114,#22105 (comment)| License       | MIT| Doc PR        |Commits-------a2079d6 [Yaml] fix multiline block handling
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@xabbuhxabbuhxabbuh approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

5 participants

@chalasr@javiereguiluz@xabbuh@GuilhemN@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp