Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#4248 closed defect (bug) (fixed)

Workaround for XML-RPC bug in PHP 5.2.2

Reported by: kelson's profile kelson Owned by: rob1n's profile rob1n
Milestone: 2.2 Priority: normal
Severity: major Version:
Component: XML-RPC Keywords: xmlrpc has-patch commit
Focuses: 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 (1)

4248.diff (626 bytes) - added by rob1n 17 years ago.

Download all attachments as: .zip

Change History (10)

#1 @rob1n
17 years ago

  • Milestone changed from 2.4 to 2.3
  • Owner changed from anonymous to rob1n

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?

#2 @rob1n
17 years ago

  • Description modified (diff)

@rob1n
17 years ago

#3 @rob1n
17 years ago

  • Keywords has-patch 2nd-opinion added

#4 @rob1n
17 years ago

  • Status changed from new to assigned

#5 @rob1n
17 years ago

  • Keywords commit added; 2nd-opinion removed

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

#6 @rob1n
17 years ago

Oh, and the guy confirmed it worked, too.

#7 @rob1n
17 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

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

#8 @Nazgul
17 years ago

  • Milestone changed from 2.3 to 2.2
  • Resolution fixed deleted
  • Status changed from closed to reopened

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.

#9 @ryan
17 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

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

Note: See TracTickets for help on using tickets.