ID: 37853
User updated by: jona at oismail dot com
Reported By: jona at oismail dot com
-Status: Feedback
+Status: Open
Bug Type: Reproducible crash
Operating System: Windows 2000
PHP Version: 5.1.4
New Comment:
I get an "PHP has encountered an Access Violation at 01B1B9F3" for both
v5.1.4 and v5.2-dev.
Are you running PHP as an ISAPI module?
Previous Comments:
------------------------------------------------------------------------
[2006-06-19 21:28:55] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
I get two error messages and no crash:
Warning: DOMDocument::loadXML(): xmlParseEntityRef: no name in Entity,
line: 3 in /tmp/3.php on line 27
Warning: DOMDocument::schemaValidateSource(): The document has no
document element. in /tmp/3.php on line 29
------------------------------------------------------------------------
[2006-06-19 20:46:07] jona at oismail dot com
Description:
------------
When an unescaped & is encounted in an XML document, PHP causes an
access violation in IIS when DOM schemaValidate or DOM
schemaValidateSource is called.
I have PHP running as an ISAPI module using the php5isapi.dll
Reproduce code:
---------------
<?php
$sXML = '<?xml version="1.0" encoding="ISO-8859-5"?>
<root type="input"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="input.xsd">
<username>Jona&</username>
</root>';
$sSchema = '<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:simpleType name="string">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
</xs:restriction>
</xs:simpleType>
<xs:element name="root">
<xs:complexType>
<xs:choice>
<xs:element name="username" type="string" />
<xs:element name="password" type="string" />
</xs:choice>
<xs:attribute name="type" type="xs:string" use="required"
fixed="input" />
</xs:complexType>
</xs:element>
</xs:schema>';
$obj_DOM = new DOMDocument("1.0", "ISO-8859-5");
$obj_DOM->loadXML(trim($sXML) );
$obj_DOM->schemaValidateSource($sSchema);
?>
Expected result:
----------------
Warning thrown along the lines of "Invalid XML document" or
schemaValidate returns false.
Actual result:
--------------
PHP has encountered an Access Violation at 01B1E093
Warning: DOMDocument::loadXML() [function.DOMDocument-loadXML]:
xmlParseEntityRef: no name in Entity, line: 3 in
D:\www\php5api\webroot\xml_schema_test.php on line 27
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37853&edit=1