Make WordPress Core

Opened 21 years ago

Closed 21 years ago

Last modified 20 years ago

#2350 closed defect (bug) (fixed)

$HTTP_RAW_POST_DATA not set

Reported by: Juergen Owned by: westi
Priority: normal Milestone:
Component: General Version: 2.0
Severity: normal Keywords: bg|2nd-opinion bg|dev-feedback bg|has-patch
Cc: Focuses:

Description

xmlrpc.php spits out that error when accessed not via POST. Fix attached.

Attachments (1)

xmlrpc.patch (481 bytes ) - added by Juergen 21 years ago.

Download all attachments as: .zip

Change History (5)

@Juergen
21 years ago

#1 @westi
21 years ago

  • Keywords bg|2nd-opinion bg|dev-feedback bg|has-patch added
  • Milestone2.0.1
  • Owner changed from anonymous to westi
  • Status newassigned

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.

#2 @Juergen
21 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.

#3 @ryan
21 years ago

  • Resolutionfixed
  • Status assignedclosed

(In [3498]) Check if HTTP_RAW_POST_DATA is set to avoid undefined var warning. Props Juergen. fixes #2350

#4 @(none)
20 years ago

  • Milestone 2.0.1

Milestone 2.0.1 deleted

Note: See TracTickets for help on using tickets.