php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43089 DOMDocument::loadXML() causes warning not trapped by libxml errors
Submitted: 2007-10-23 19:02 UTC Modified: 2007-10-23 21:13 UTC
From: mike at silverorange dot com Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 5.2.4 OS:
Private report: No CVE-ID: None
 [2007-10-23 19:02 UTC] mike at silverorange dot com
Description:
------------
When libxml_use_internal_errors() is used, DOMDocument::loadXML() still causes a general PHP warning to be raised when passed an empty string.

If this is by design, the documentation should mention this warning will be triggered if an empty string is used.

Reproduce code:
---------------
$errors = libxml_use_internal_errors(true);

$document = new DOMDocument();
var_dump($document->loadXML(''));
       
libxml_clear_errors();
libxml_use_internal_errors($errors);

Expected result:
----------------
bool(false)

Actual result:
--------------
Warning: DOMDocument::loadXML() [function.DOMDocument-loadXML]: Empty string supplied as input

bool(false)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-23 21:13 UTC] scottmac@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

The error is from by PHP, not libxml which libxml_use_internal_errors() corresponds to.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 16:01:27 2024 UTC