diff --git a/src/wp-includes/IXR/class-IXR-server.php b/src/wp-includes/IXR/class-IXR-server.php
index 9702ba28b7..3112d23815 100644
a
|
b
|
function serve($data = false) |
47 | 47 | die('XML-RPC server accepts POST requests only.'); |
48 | 48 | } |
49 | 49 | |
50 | | global $HTTP_RAW_POST_DATA; |
51 | | if (empty($HTTP_RAW_POST_DATA)) { |
52 | | // workaround for a bug in PHP 5.2.2 - http://bugs.php.net/bug.php?id=41293 |
53 | | $data = file_get_contents('php://input'); |
54 | | } else { |
55 | | $data =& $HTTP_RAW_POST_DATA; |
56 | | } |
| 50 | $data = file_get_contents('php://input'); |
57 | 51 | } |
58 | 52 | $this->message = new IXR_Message($data); |
59 | 53 | if (!$this->message->parse()) { |
diff --git a/src/wp-includes/rest-api/class-wp-rest-server.php b/src/wp-includes/rest-api/class-wp-rest-server.php
index 0ab94bbbde..a7c43b041f 100644
a
|
b
|
public function remove_header( $key ) { |
1371 | 1371 | * @return string Raw request data. |
1372 | 1372 | */ |
1373 | 1373 | public static function get_raw_data() { |
| 1374 | // phpcs:disable PHPCompatibility.Variables.RemovedPredefinedGlobalVariables.http_raw_post_dataDeprecatedRemoved |
1374 | 1375 | global $HTTP_RAW_POST_DATA; |
1375 | 1376 | |
1376 | | /* |
1377 | | * A bug in PHP < 5.2.2 makes $HTTP_RAW_POST_DATA not set by default, |
1378 | | * but we can do it ourself. |
1379 | | */ |
| 1377 | // $HTTP_RAW_POST_DATA was deprecated in PHP 5.6 and removed in PHP 7.0. |
1380 | 1378 | if ( ! isset( $HTTP_RAW_POST_DATA ) ) { |
1381 | 1379 | $HTTP_RAW_POST_DATA = file_get_contents( 'php://input' ); |
1382 | 1380 | } |
1383 | 1381 | |
1384 | 1382 | return $HTTP_RAW_POST_DATA; |
| 1383 | // phpcs:enable |
1385 | 1384 | } |
1386 | 1385 | |
1387 | 1386 | /** |
diff --git a/src/xmlrpc.php b/src/xmlrpc.php
index 00bd97e8df..341a6dc84d 100644
a
|
b
|
|
15 | 15 | // Some browser-embedded clients send cookies. We don't want them. |
16 | 16 | $_COOKIE = array(); |
17 | 17 | |
18 | | // A bug in PHP < 5.2.2 makes $HTTP_RAW_POST_DATA not set by default, |
19 | | // but we can do it ourself. |
| 18 | // $HTTP_RAW_POST_DATA was deprecated in PHP 5.6 and removed in PHP 7.0. |
| 19 | // phpcs:disable PHPCompatibility.Variables.RemovedPredefinedGlobalVariables.http_raw_post_dataDeprecatedRemoved |
20 | 20 | if ( ! isset( $HTTP_RAW_POST_DATA ) ) { |
21 | 21 | $HTTP_RAW_POST_DATA = file_get_contents( 'php://input' ); |
22 | 22 | } |
… |
… |
|
25 | 25 | if ( isset( $HTTP_RAW_POST_DATA ) ) { |
26 | 26 | $HTTP_RAW_POST_DATA = trim( $HTTP_RAW_POST_DATA ); |
27 | 27 | } |
| 28 | // phpcs:enable |
28 | 29 | |
29 | 30 | /** Include the bootstrap for setting up WordPress environment */ |
30 | 31 | require_once __DIR__ . '/wp-load.php'; |