Skip to content

Commit 4a052d5

Browse files
committed
feature symfony#19883 [Serializer] Add missing XML serializer's CDATA options (alexpozzi)
This PR was merged into the 7.1 branch. Discussion ---------- [Serializer] Add missing XML serializer's CDATA options Fixes symfony#19851 Commits ------- c6d3512 Add missing XML serializer's CDATA options
2 parents 697b047 + c6d3512 commit 4a052d5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

components/serializer.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,11 +1200,17 @@ Option Description
12001200
``remove_empty_tags`` If set to true, removes all empty tags in the ``false``
12011201
generated XML
12021202
``cdata_wrapping`` If set to false, will not wrap any value ``true``
1203-
containing one of the following characters (
1204-
``<``, ``>``, ``&``) in `a CDATA section`_ like
1205-
following: ``<![CDATA[...]]>``
1203+
matching the ``cdata_wrapping_pattern`` regex in
1204+
`a CDATA section`_ like following:
1205+
``<![CDATA[...]]>``
1206+
``cdata_wrapping_pattern`` A regular expression pattern to determine if a ``/[<>&]/``
1207+
value should be wrapped in a CDATA section
12061208
============================== ================================================= ==========================
12071209

1210+
.. versionadded:: 7.1
1211+
1212+
The `cdata_wrapping_pattern` option was introduced in Symfony 7.1.
1213+
12081214
Example with custom ``context``::
12091215

12101216
use Symfony\Component\Serializer\Encoder\XmlEncoder;

0 commit comments

Comments
 (0)