#26947 [Opn->Fbk]: Crash by using DomDocument::getElementById()
| From: | sniper@php.net | Date: | Sun, 18 Jan 2004 01:23:59 +0000 |
| Subject: | #26947 [Opn->Fbk]: Crash by using DomDocument::getElementById() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-53505@lists.php.net to get a copy of this message | ||
ID: 26947
Updated by: sniper@php.net
Reported By: olivier dot bichler at laposte dot net
-Status: Open
+Status: Feedback
Bug Type: *XML functions
Operating System: Windows XP pro (SP1)
PHP Version: 5.0.0b3 (beta3)
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2004-01-17 12:57:02] olivier dot bichler at laposte dot net
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.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26947&edit=1