Skip to content

Commit

Permalink
Fixed 7701: XMLRPC API returns "XML-RPC server accepts POST requests …
Browse files Browse the repository at this point in the history
…only" for any request

PHP7 compatibility issue
Solved using comments on
http://php.net/manual/it/reserved.variables.httprawpostdata.php
  • Loading branch information
fmancardi committed Jan 7, 2017
1 parent 53a6e47 commit c7fae78
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions third_party/xml-rpc/class-IXR.php
Expand Up @@ -5,12 +5,6 @@
*
* @internal revisions
*
* 20131220 - moormanm - Adding 'limit' parameter to preg_replace call so to not exceed pcre.backtrack max
* when processing large xmlrpc messages
*
* 20111022 - franciscom - due to use of is_a() without checking that object was REALLY an object
* and tlAutoload(), result was CRASH trying to creating NON EXISTENT class
* when method return type is SIMPLE (string,int)
*/

/*
Expand Down Expand Up @@ -290,11 +284,11 @@ function IXR_Server($callbacks = false, $data = false) {
}
function serve($data = false) {
if (!$data) {
global $HTTP_RAW_POST_DATA;
if (!$HTTP_RAW_POST_DATA) {
$postdata = file_get_contents("php://input");
if (!$postdata) {
die('XML-RPC server accepts POST requests only.');
}
$data = $HTTP_RAW_POST_DATA;
$data = $postdata;
}
$this->message = new IXR_Message($data);
if (!$this->message->parse()) {
Expand Down

0 comments on commit c7fae78

Please sign in to comment.