Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #54346 [Serializer] Fix: Report Xml warning/error instead of …
…silently returning a wrong xml (VincentLanglet) This PR was squashed before being merged into the 7.1 branch. Discussion ---------- [Serializer] Fix: Report Xml warning/error instead of silently returning a wrong xml | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT When `DomDocument::saveXML` encounter an error/warning, for example ``` DOMDocument::saveXML(): xmlEscapeEntities : char out of range ``` the method will return false or an empty/incomplete XML. In case of `false`, since symfony doesn't use strict type, it will be cast into `string` (for 6.4+ version with native typehint) so the `encode` method will return an empty string. In case of empty/incomplete XML, symfony returns it as if, without any notice about the error/warning. I think Symfony should not silently ignore such XML error when decoding. Or should it be an option ? Commits ------- 70e74dd [Serializer] Fix: Report Xml warning/error instead of silently returning a wrong xml
- Loading branch information