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

Appearance settings

[Yaml] removed YAML parser \ escaping in double-quotes #16203

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 12, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions 6 src/Symfony/Component/Yaml/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
CHANGELOG
=========

3.0.0
-----

* Yaml::parse() now throws an exception when a blackslash is not escaped
in double-quoted strings

2.8.0
-----

Expand Down
6 changes: 3 additions & 3 deletions 6 src/Symfony/Component/Yaml/Tests/InlineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ public function testHashStringsResemblingExponentialNumericsShouldNotBeChangedTo
}

/**
* @group legacy
* throws \Symfony\Component\Yaml\Exception\ParseException in 3.0
* @expectedException \Symfony\Component\Yaml\Exception\ParseException
* @expectedExceptionMessage Found unknown escape character "\V".
*/
public function testParseScalarWithNonEscapedBlackslashShouldThrowException()
{
$this->assertSame('Foo\Var', Inline::parse('"Foo\Var"'));
Inline::parse('"Foo\Var"');
}

/**
Expand Down
11 changes: 4 additions & 7 deletions 11 src/Symfony/Component/Yaml/Unescaper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace Symfony\Component\Yaml;

use Symfony\Component\Yaml\Exception\ParseException;

/**
* Unescaper encapsulates unescaping rules for single and double-quoted
* YAML strings.
Expand Down Expand Up @@ -59,11 +61,8 @@ public function unescapeDoubleQuotedString($value)
* @param string $value An escaped character
*
* @return string The unescaped character
*
* @internal This method is public to be usable as callback. It should not
* be used in user code. Should be changed in 3.0.
*/
public function unescapeCharacter($value)
private function unescapeCharacter($value)
{
switch ($value[1]) {
case '0':
Expand Down Expand Up @@ -113,9 +112,7 @@ public function unescapeCharacter($value)
case 'U':
return self::utf8chr(hexdec(substr($value, 2, 8)));
default:
@trigger_error('Not escaping a backslash in a double-quoted string is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.', E_USER_DEPRECATED);

return $value;
throw new ParseException(sprintf('Found unknown escape character "%s".', $value));
}
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.