#40529 [Opn->Bgs]: invalid SimpleXMLElement forces HTTP 200 header
| From: | derick@php.net | Date: | Sun, 18 Feb 2007 01:47:26 +0000 |
| Subject: | #40529 [Opn->Bgs]: invalid SimpleXMLElement forces HTTP 200 header | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-109068@lists.php.net to get a copy of this message | ||
ID: 40529
Updated by: derick@php.net
Reported By: PK at eBrain dot nl
-Status: Open
+Status: Bogus
Bug Type: SimpleXML related
Operating System: Fedore Core 3
PHP Version: 5.2.1
New Comment:
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP --
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
.
Previous Comments:
------------------------------------------------------------------------
[2007-02-17 23:17:07] PK at eBrain dot nl
Description:
------------
When SimpleXMLElement in run on something invalid or empty, the HTTP
status code is forced to 200 and can not be influenced later on. Either
this is a bug or expected behavior - in the last case, it should be:
documented on http://nl2.php.net/simplexml/ + explained
how to work
around it.
Note: my actual PHP version is: 5.0.4
Reproduce code:
---------------
Note: php://input is empty (i.e. a direct request to the page).
$PostXML = new SimpleXMLElement('php://input');
if (empty($PostXML))
{
header('HTTP/1.1 400 Bad Request');
}
else
{
header('HTTP/1.1 202 Accepted');
}
Expected result:
----------------
HTTP Status Code: HTTP/1.1 400
Actual result:
--------------
HTTP Status Code: HTTP/1.1 200
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40529&edit=1