Ticket #4248 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Workaround for XML-RPC bug in PHP 5.2.2

Reported by: kelson Assigned to: rob1n
Priority: normal Milestone: 2.2
Component: XML-RPC Version:
Severity: major Keywords: xmlrpc has-patch commit
Cc:

Description (Last modified by rob1n)

I'm not sure if this is even appropriate here, since it's not really WordPress' fault, but there's a bug in PHP 5.2.2 that prevents XMLRPC from working properly. Basically, $HTTP_RAW_POST_DATA is never set, even when called via POST or with the config option set to always be on.

It's possible to work around it in WP 2.2 by adding one line to the beginning of WordPress' xmlrpc.php file, right before the first mention of the variable.

$HTTP_RAW_POST_DATA = file_get_contents("php://input");

It's apparently fixed in the PHP CVS, but who knows how long it'll be before 5.2.3 comes out.

Anyway, I don't know if you'll want to include a workaround for a single-version bug (though this is the most current "stable" release) or what impact this would have running on other versions of PHP, but I thought I'd post it just to convey the info.

Attachments

4248.diff (0.6 kB) - added by rob1n on 05/11/07 00:51:54.

Change History

05/11/07 00:48:15 changed by rob1n

  • owner changed from anonymous to rob1n.
  • milestone changed from 2.4 to 2.3.

I'm thinking we should fix this. Hosts, at least in my experience, aren't really known to upgrade when a new release comes out, at least right away. Besides, I don't think it hurts fixed versions of PHP, does it?

05/11/07 00:48:38 changed by rob1n

  • description changed.

05/11/07 00:51:54 changed by rob1n

  • attachment 4248.diff added.

05/11/07 00:52:12 changed by rob1n

  • keywords changed from xmlrpc to xmlrpc has-patch 2nd-opinion.

05/11/07 00:52:16 changed by rob1n

  • status changed from new to assigned.

05/11/07 03:14:34 changed by rob1n

  • keywords changed from xmlrpc has-patch 2nd-opinion to xmlrpc has-patch commit.

A comment in the PHP bug linked to in the description has this exact same fix.

05/11/07 03:14:45 changed by rob1n

Oh, and the guy confirmed it worked, too.

05/11/07 03:21:06 changed by rob1n

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [5445]) Fix for PHP version 5.2.2 where $HTTP_RAW_POST_DATA isn't set. fixes #4248

05/11/07 06:38:12 changed by Nazgul

  • status changed from closed to reopened.
  • resolution deleted.
  • milestone changed from 2.3 to 2.2.

I'd like to champion this ticket for 2.2 inclusion.

Why:
- By the time 2.3 ships most hosters will still run PHP 4.x or live on the edge and run on >= 5.2.3. This fix will not help many people any more then, because they're not affected.
- When 2.2 is released 5.2.2 is used by the people living on the edge. Therefore this fix actually helps a lot of people.

05/11/07 21:40:16 changed by ryan

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [5452]) Fix for PHP version 5.2.2 where isn't set. fixes #4248 for 2.2