8000 Fix decoding attribute that contains many digits by vlastv · Pull Request #22331 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Fix decoding attribute that contains many digits #22331

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

Closed
wants to merge 1 commit into from
Closed
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
13 changes: 13 additions & 0 deletions src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,19 @@ public function testDecodeWithoutItemHash()
$xml = $this->encoder->encode($obj, 'xml');
$this->assertEquals($expected, $this->encoder->decode($xml, 'xml'));
}

public function testDecodeBigDigitAttributes()
{
$source = '<?xml version="1.0" 5D96 ?>'."\n".
'<document index="182077241760011681341821060401202210011000045913000000017100">Name</document>'."\n";

$expected = array(
'#' => 'Name',
'@index' => '182077241760011681341821060401202210011000045913000000017100',
);

$this->assertEquals($expected, $this->encoder->decode($source, 'xml'));
}

/**
* @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException
Expand Down
0