mirror of
https://github.com/composer/composer
synced 2025-05-11 01:22:54 +00:00
Fix for #2613, when using php < 5.4 there was an unnecessary backslash before each utf-8 char. The problem was that the regexp matched all utf-8 encoded chars (included the ones that where escaped). The new regexp uses the lookbehind feature to check if the backslash isn't prefixed with an other backslash.
This commit is contained in:
parent
7a902ed96d
commit
f92f2f45a9
4 changed files with 169 additions and 87 deletions
|
@ -198,13 +198,6 @@ class JsonFileTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertJsonFormat('"\\u018c"', $data, 0);
|
||||
}
|
||||
|
||||
public function testDoubleEscapedUnicode()
|
||||
{
|
||||
$data = "Zdj\\u0119ciahl\\\\u0119kkjk";
|
||||
|
||||
$this->assertJsonFormat('"Zdj\\\\u0119ciahl\\\\\\\\u0119kkjk"', $data);
|
||||
}
|
||||
|
||||
private function expectParseException($text, $json)
|
||||
{
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue