saveXML() doesn't accept null anymore
| Bug #46191 | Back-comp break: DOMDocument::saveXML() doesn't accept null anymore | ||||
|---|---|---|---|---|---|
| Submitted: | 2008-09-28 10:09 UTC | Modified: | 2008-09-28 12:04 UTC | ||
| From: | zizka at seznam dot cz | Assigned: | |||
| Status: | Closed | Package: | DOM XML related | ||
| PHP Version: | 5.2.6 | OS: | Any | ||
| Private report: | No | CVE-ID: | None | ||
[2008-09-28 10:09 UTC] zizka at seznam dot cz
Description: ------------ In PHP 5.2.5, DOMDocument::saveXML() accepted null as it's first argument, which has this documentation: Use this parameter to output only a specific node without XML declaration rather than the entire document. In PHP 5.2.6, passing null causes error. Reproduce code: --------------- // $doc is a DOM document object. return $doc->saveXML(null, LIBXML_NOEMPTYTAG); Expected result: ---------------- IMHO null is reasonable value, meaning that whole document should be saved. I suggest to fix this backward compatibility break. Actual result: -------------- Catchable fatal error: Argument 1 passed to DOMDocument::saveXML() must be an instance of DOMNode, null given, called in ...\index.php on line 97 and defined in ...\inc.Menu.php on line 23
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2008-09-28 12:04 UTC] rrichards@php.net