-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Serializer] Allow to pass flags to XmlEncoder #17987
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
Comments
I've opened a pr to make the encoder configurable: #18036 However I'm not sure that exposing this configuration trough the framework bundle is a good idea: changing options globally through this configuration option will impact all usages of this encoder. For instance if someone enable non-safe options to fit its own need with a custom development, it will also impact API Platform that uses encoders registered by the bundle. |
@dunglas agree with you, my usecase just concerns a single route. If your PR and overriding or decorating the |
We can override the setting once this PR is fixed? |
…(dunglas) This PR was squashed before being merged into the 3.1-dev branch (closes #18036). Discussion ---------- [Serializer] XmlEncoder: Make load flags configurable | Q | A | ------------- | --- | Branch | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #17987 | License | MIT | Doc PR | todo Commits ------- 0826068 [Serializer] XmlEncoder: Make load flags configurable
Ever since we upgraded our server, libxml was upgraded to
2.9
, which introduced a protection on the max text length.We have one single route for which we want to add
LIBXML_PARSEHUGE
to theXmlEncoder
, because an external party delivers us huge text nodes. Our problem is that the decoding happens (and makes the application crash) pre-controller in theFOS\RestBundle\EventListener\BodyListener:114
. See #17956 and #16873 for more background information. What should be done to solve this:XmlEncoder
flags configurable, as @dunglas proposes in Allow loading big xml files with XmlEncoder #17956 (comment)FrameworkBundle
to configure these flags on a specific route, maybe @nicolas-grekas can elaborate on what he meant in Allow loading big xml files with XmlEncoder #17956 (comment).BodyListener
is executed. It has priority 10 onkernel.request
.The text was updated successfully, but these errors were encountered: