Skip to content

[Serializer] paralell XMLEncoder::encode can cause "Wrong Document Error" #37354

Closed
@connorhu

Description

@connorhu

Symfony version(s) affected: 5.0

Description
If you start an XMLEncode::encode process in the middle of a normalization (you need to create an base64 encoded XML sub document), cause an "Wrong Document Error" DomDocument exception at:

$parentNode->appendChild($node);

Here is the call stack:

How to reproduce
Create an XML with an base64 encoded xml subcontent:

<?xml version="1.0"?>
<node>...base64encoded xml...</node>

xml to base64 encode:

<?xml version="1.0"?>
<node2>test</node2>

Possible Solution
DOMDocument of XMLEncoder should stackable.

Additional context
I will post repo, test and PR later.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions