Req #80357 [Opn->Fbk]: Unable to re-enable entity loader without triggering a deprecation
| From: | requinix@php.net | Date: | Thu, 12 Nov 2020 20:41:40 +0000 |
| Subject: | Req #80357 [Opn->Fbk]: Unable to re-enable entity loader without triggering a deprecation | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-230313@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80357&edit=1
ID: 80357
Updated by: requinix@php.net
Reported by: jeremy at derusse dot com
Summary: Unable to re-enable entity loader without triggering
a deprecation
-Status: Open
+Status: Feedback
Type: Feature/Change Request
Package: *XML functions
Operating System: All
PHP Version: 8.0.0RC4
Block user comment: N
Private report: N
New Comment:
As far as I can tell, the whole point of the change was to deprecate the entire function and force
callers who want entity loading to do so at the time of loading (using LIBXML_NOENT). Eventually it
will be removed entirely, which would make a "libxml_entity_loader_disabled" function
pointless.
IMO this is one of those times when you should use @ to suppress the warning. I mean, if there is
code that disables the loader then it will be triggering the deprecation warning too, right?
Previous Comments:
------------------------------------------------------------------------
[2020-11-12 20:02:02] jeremy at derusse dot com
Description:
------------
calling libxml_disable_entity_loader has been deprecated in PHP >= 8.0
(https://github.com/php/php-src/pull/5867)
But if a 3rd party library disable the entity loader, we have no way to re-enable it (or even to
know if we have to re-enable it) without triggering a deprecation.
Suggested change:
- do not trigger deprecation when calling the method with
false
- add a new method libxml_entity_loader_disabled() that returns true/false when the
entity loader is disabled
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80357&edit=1