File tree 3 files changed +13
-10
lines changed
src/Symfony/Component/Yaml
3 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 1
1
CHANGELOG
2
2
=========
3
3
4
+ 3.0.0
5
+ -----
6
+
7
+ * Yaml::parse() now throws an exception when a blackslash is not escaped
8
+ in double-quoted strings
9
+
4
10
2.8.0
5
11
-----
6
12
Original file line number Diff line number Diff line change @@ -71,12 +71,12 @@ public function testHashStringsResemblingExponentialNumericsShouldNotBeChangedTo
71
71
}
72
72
73
73
/**
74
- * @group legacy
75
- * throws \Symfony\Component\Yaml\Exception\ParseException in 3.0
74
+ * @expectedException \Symfony\Component\Yaml\Exception\ParseException
75
+ * @expectedExceptionMessage Found unknown escape character "\V".
76
76
*/
77
77
public function testParseScalarWithNonEscapedBlackslashShouldThrowException ()
78
78
{
79
- $ this -> assertSame ( ' Foo\Var ' , Inline::parse ('"Foo\Var" ' ) );
79
+ Inline::parse ('"Foo\Var" ' );
80
80
}
81
81
82
82
/**
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Component \Yaml ;
13
13
14
+ use Symfony \Component \Yaml \Exception \ParseException ;
15
+
14
16
/**
15
17
* Unescaper encapsulates unescaping rules for single and double-quoted
16
18
* YAML strings.
@@ -59,11 +61,8 @@ public function unescapeDoubleQuotedString($value)
59
61
* @param string $value An escaped character
60
62
*
61
63
* @return string The unescaped character
62
- *
63
- * @internal This method is public to be usable as callback. It should not
64
- * be used in user code. Should be changed in 3.0.
65
64
*/
66
- public function unescapeCharacter ($ value )
65
+ private function unescapeCharacter ($ value )
67
66
{
68
67
switch ($ value [1 ]) {
69
68
case '0 ' :
@@ -113,9 +112,7 @@ public function unescapeCharacter($value)
113
112
case 'U ' :
114
113
return self ::utf8chr (hexdec (substr ($ value , 2 , 8 )));
115
114
default :
116
- @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 );
117
-
118
- return $ value ;
115
+ throw new ParseException (sprintf ('Found unknown escape character "%s". ' , $ value ));
119
116
}
120
117
}
121
118
You can’t perform that action at this time.
0 commit comments