libxml_disable_entity_loader
libxml_disable_entity_loader
Disable the ability to load external entities
bool **libxml_disable_entity_loader** bool $disable
Disable/enable the ability to load external entities. Note that disabling the loading of external entities may cause general issues with loading XML documents.
As of libxml 2.9.0 entity substitution
is disabled by default, so there is no need to disable the loading of external
entities,
unless there is the need to resolve internal entity references with ,
, or .
Generally, it is preferable to use
to suppress loading of external entities.
The constant can be used to prevent this as well (only available in Libxml >= 2.13.0, as of PHP 8.4.0).
LIBXML_NOENT``LIBXML_DTDVALID``LIBXML_DTDLOAD``libxml_set_external_entity_loader``LIBXML_NO_XXE
disableDisable (true) or enable (false) libxml extensions (such as
,
and ) to load external entities.
Returns the previous value.
libxml_use_internal_errors``libxml_set_external_entity_loader``LIBXML_NOENT``LIBXML_DTDVALID``LIBXML_NO_XXE