From: jonas at carello dot se
Operating system: Windows 2003
PHP version: 5.2.1
PHP Bug Type: SimpleXML related
Bug description: Using addAttribute() on a child named "Host" causes error.
Description:
------------
Tested on PHP 5.1.3 -> 5.2.1
Using addAttribute() when referring to a child called "Host" causes PHP to
return a CGI Error.
Reproduce code:
---------------
<?php
$string = <<<XML
<?xml version="1.0"?>
<Host enable="true">
<Name>host.server.com</Name>
</Host>
XML;
$xml = simplexml_load_string($string);
$add = $xml->addChild('Host');
$add->Host->addAttribute('enable', 'true');
?>
Expected result:
----------------
Running it should add a child called "Host" and add the attribute "enable"
with the value "true".
Actual result:
--------------
$add = $xml->addChild('Host') works fine.
Adding an attribute to a child named "Host" however, results in:
"The specified CGI application misbehaved by not returning a complete set
of HTTP headers."
--
Edit bug report at http://bugs.php.net/?id=40451&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=40451&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=40451&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=40451&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40451&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=40451&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=40451&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=40451&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=40451&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=40451&r=support
Expected behavior: http://bugs.php.net/fix.php?id=40451&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=40451&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=40451&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40451&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40451&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40451&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=40451&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=40451&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=40451&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=40451&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=40451&r=mysqlcfg