libxml_disable_entity_loader
(PHP 5 >= 5.2.11, PHP 7, PHP 8)
Disable the ability to load external entities
Function-8-0-0
Description
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 LIBXML_NOENT, LIBXML_DTDVALID, or LIBXML_DTDLOAD. Generally, it is preferable to use libxml_set_external_entity_loader() to suppress loading of external entities. The LIBXML_NO_XXE constant can be used to prevent this as well (only available in Libxml >= 2.13.0, as of PHP 8.4.0).
Parameters
disableDisable (true) or enable (false) libxml extensions (such as book.dom, book.xmlwriter and book.xmlreader) to load external entities.
Return Values
Returns the previous value.
Changelog
| Version | Description |
|---|---|
| 8.0.0 | This function has been deprecated. |
See Also
libxml_use_internal_errors()libxml_set_external_entity_loader()- The
LIBXML_NOENTconstant - The
LIBXML_DTDVALIDconstant - The
LIBXML_NO_XXEconstant