php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40451 Using addAttribute() on a child named "Host" causes error.
Submitted: 2007-02-12 20:48 UTC Modified: 2007-02-12 21:06 UTC
From: jonas at carello dot se Assigned:
Status: Closed Package: SimpleXML related
PHP Version: 5.2.1 OS: Windows 2003
Private report: No CVE-ID:
 [2007-02-12 20:48 UTC] 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."

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-12 21:06 UTC] tony2001@php.net
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.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sat Apr 19 09:02:28 2014 UTC