#40451 [Opn->Csd]: Using addAttribute() on a child named "Host" causes error.
| From: | tony2001@php.net | Date: | Mon, 12 Feb 2007 21:06:49 +0000 |
| Subject: | #40451 [Opn->Csd]: Using addAttribute() on a child named "Host" causes error. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-108759@lists.php.net to get a copy of this message | ||
ID: 40451
Updated by: tony2001@php.net
Reported By: jonas at carello dot se
-Status: Open
+Status: Closed
Bug Type: SimpleXML related
Operating System: Windows 2003
PHP Version: 5.2.1
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2007-02-12 20:48:54] jonas at carello dot se
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 this bug report at http://bugs.php.net/?id=40451&edit=1