#22338 [Opn]: XML-RPC classes rely on $HTTP_RAW_POST_DATA
| From: | mansion@php.net | Date: | Sun, 27 Apr 2003 09:56:51 +0000 |
| Subject: | #22338 [Opn]: XML-RPC classes rely on $HTTP_RAW_POST_DATA | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-15594@lists.php.net to get a copy of this message | ||
ID: 22338
Updated by: mansion@php.net
Reported By: stuart at gnqs dot org
Status: Open
Bug Type: PEAR related
Operating System: Windows XP
PHP Version: 4.3.0
New Comment:
I agree with that, the best way is to use php://input
when $HTTP_RAW_POST_DATA is not set.
This is how it's done in horde [1] and in a few other
applications.
IMO, this should be changed in XMLRPC package but I
don't know who is the maintainer of this package.
[1] http://cvs.horde.org/co.php/horde/rpc.php?r=1.14
Previous Comments:
------------------------------------------------------------------------
[2003-04-27 04:20:48] stuart at gnqs dot org
Hi Philip,
A simple one-liner proves that $HTTP_RAW_POST_DATA doesn't exist when
register_globals=off
<?php
echo $HTTP_RAW_POST_DATA
?>
On my PHP installation, that generates the error:
Notice: Undefined variable: HTTP_RAW_POST_DATA in
c:\devel\htdocs\test.php on line 3
I'd never heard of a 'always_populate_raw_post_data' directive.
Wouldn't it be better to make the code work without having to set
specific directives in php.ini files (not everyone has permissions to
do this, y'know)? If you use the php://input stream to get the data
instead, this will work in every installation.
Best regards,
Stu
--
------------------------------------------------------------------------
[2003-04-26 18:21:01] philip@php.net
Actually, this variable is not affected by register_globals, it doesn't
live in any superglobal. It's its own variable.
AFAICT its created when either an unrecognized mime type is provided
and/or the php directive always_populate_raw_post_data = on.
I tried to grasp it once but gave up, here are the related threads:
http://marc.theaimsgroup.com/?l=php-dev&m=103688014620968
http://marc.theaimsgroup.com/?l=php-dev&m=103709898507271
Maybe someone with a better understanding of HTTP can make sense of all
this, sorry to get a little offtopic.
------------------------------------------------------------------------
[2003-02-20 15:19:23] stuart at gnqs dot org
Hi,
Just been looking at the XML-RPC classes in PEAR. Granted, I haven't
tried running the code, but from inspection it appears to rely on
$HTTP_RAW_POST_DATA. That particular variable doesn't exist if
register_globals is set to 'off'.
The php://input stream has been around since PHP 3.x (according to the
manual), and might be a more portable way of handling this. Just
tested this under PHP 4.3.0 with register_globals off, and (as
expected) it worked fine.
Do any other classes in PEAR rely on $HTTP_RAW_POST_DATA?
Best regards,
Stu
--
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22338&edit=1