mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Fixed json encoding when quoted value contained trailing backslash.
Condition checking if current character is inside a quoted string did not consider the case when backslash before quote is escaped with another backslash.
This commit is contained in:
parent
4dee2528e9
commit
c680ec7e51
2 changed files with 10 additions and 1 deletions
|
@ -93,6 +93,15 @@ class JsonFileTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertJsonFormat($json, $data);
|
||||
}
|
||||
|
||||
public function testTrailingBackslash()
|
||||
{
|
||||
$data = array('Metadata\\' => 'src/');
|
||||
$json = '{
|
||||
"Metadata\\\\": "src\/"
|
||||
}';
|
||||
$this->assertJsonFormat($json, $data);
|
||||
}
|
||||
|
||||
private function expectParseException($text, $json)
|
||||
{
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue