Skip to content

Commit 9acfa18

Browse files
authored
Document XML_OPTION_PARSE_HUGE (#3899)
* Document XML_OPTION_PARSE_HUGE * Address review comments
1 parent fe42297 commit 9acfa18

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

reference/xml/constants.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,19 @@
257257
</simpara>
258258
</listitem>
259259
</varlistentry>
260+
<varlistentry xml:id="constant.xml-option-parse-huge">
261+
<term>
262+
<constant>XML_OPTION_PARSE_HUGE</constant>
263+
(<type>int</type>)
264+
</term>
265+
<listitem>
266+
<simpara>
267+
Available as of PHP 8.4.0.
268+
When libxml2 &lt; 2.7.0 is used (e.g. on PHP 7.x),
269+
this option is enabled by default and cannot be disabled.
270+
</simpara>
271+
</listitem>
272+
</varlistentry>
260273
<varlistentry xml:id="constant.xml-option-target-encoding">
261274
<term>
262275
<constant>XML_OPTION_TARGET_ENCODING</constant>

reference/xml/functions/xml-parser-get-option.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<listitem>
3636
<simpara>
3737
Which option to fetch. <constant>XML_OPTION_CASE_FOLDING</constant>,
38+
<constant>XML_OPTION_PARSE_HUGE</constant>,
3839
<constant>XML_OPTION_SKIP_TAGSTART</constant>, <constant>XML_OPTION_SKIP_WHITE</constant>
3940
and <constant>XML_OPTION_TARGET_ENCODING</constant> are available.
4041
See <function>xml_parser_set_option</function> for their description.

reference/xml/functions/xml-parser-set-option.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@
5959
XML parser. Enabled by default.
6060
</entry>
6161
</row>
62+
<row>
63+
<entry><constant>XML_OPTION_PARSE_HUGE</constant></entry>
64+
<entry>bool</entry>
65+
<entry>
66+
Allows parsing documents larger than 10 MB.
67+
This option should only be enabled when the document size is
68+
bounded because this could otherwise lead to a DoS.
69+
This option is only available when using libxml2.
70+
</entry>
71+
</row>
6272
<row>
6373
<entry><constant>XML_OPTION_SKIP_TAGSTART</constant></entry>
6474
<entry>integer</entry>
@@ -135,6 +145,12 @@
135145
</row>
136146
</thead>
137147
<tbody>
148+
<row>
149+
<entry>8.4.0</entry>
150+
<entry>
151+
Added the option <constant>XML_OPTION_PARSE_HUGE</constant>.
152+
</entry>
153+
</row>
138154
<row>
139155
<entry>8.3.0</entry>
140156
<entry>

0 commit comments

Comments
 (0)