#2350 closed defect (bug) (fixed)
$HTTP_RAW_POST_DATA not set
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.0 |
Component: | General | Keywords: | bg|2nd-opinion bg|dev-feedback bg|has-patch |
Focuses: | Cc: |
Description
xmlrpc.php spits out that error when accessed not via POST. Fix attached.
Attachments (1)
Change History (5)
#1
@
17 years ago
- Keywords bg|2nd-opinion bg|dev-feedback bg|has-patch added
- Milestone set to 2.0.1
- Owner changed from anonymous to westi
- Status changed from new to assigned
#2
@
17 years ago
I get that "XML-RPC server accepts POST requests only." too.
But additionaly I get a 'PHP Notice: Undefined variable: HTTP_RAW_POST_DATA in /sites/blog/wp/xmlrpc.php on line 9' for each non-POST request in my syslog (I'm using error_log = syslog).
It might be possible to work around this by setting 'always_populate_raw_post_data = On' but I think it's cleaner to check whether HTTP_RAW_POST_DATA is set before using it.
Note: See
TracTickets for help on using
tickets.
I'm not sure this patch is necessary.
Navigating to xmlrpc.php works fine for me on my test site running on PHP 4.4.0.
I get the expected: "XML-RPC server accepts POST requests only."
I can't see why we need to check for the variable before calling trim afterall trim has to cope with the variable you pass it containing an empty string anyway?!?
Marking this against 2.0.1 but feel that probably is WONTFIX.