|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-17 20:23 UTC] sniper@php.net
[2004-01-18 05:13 UTC] chregu@php.net
[2004-01-18 07:52 UTC] chregu@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 18:00:01 2025 UTC |
Description: ------------ PHP crash by using the DOM function getElementById() (PHP kill the Apache server process on Windows, with Apache v1.3.27 and v2.0.48). Reproduce code: --------------- <?php $dom = new DomDocument; $dom -> load('essai.xml'); if ($dom -> validate()) { $menu = new DomDocument; $menu = $dom -> getElementById('a'); echo $menu -> firstChild -> data; } ?> essai.xml : ----------- <?xml version="1.0"?> <!DOCTYPE essai [ <!ELEMENT essai (truc+)> <!ELEMENT truc (#PCDATA)> <!ATTLIST truc id ID #REQUIRED> ]> <essai> <truc id="a">1</truc> </essai> Expected result: ---------------- 1 Actual result: -------------- Nothing, PHP and the server crash... There is the same result with an external doctype. When I call getElementById(id) with an id who doesn't exist in the XML file, there is no crash.