mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-06 13:44:30 +00:00
General: Remove or add inline comments to $HTTP_RAW_POST_DATA occurrences.
The `$HTTP_RAW_POST_DATA` global was deprecated in PHP 5.6 and removed completely in PHP 7.0. In general, `php://input` should be used instead of `$HTTP_RAW_POST_DATA`. Because WordPress Core still supports PHP 5.6, some plugins or sites may still rely on this variable being present and populated with the expected data. For that reason, occurrences of the variable will remain with updated inline documentation until support for PHP 5.6 is officially dropped in WordPress. Props skoskie, jrf, desrosj, TimothyBlynJacobs. See #49922. Fixes #49810. git-svn-id: https://develop.svn.wordpress.org/trunk@47926 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -15,8 +15,8 @@ define( 'XMLRPC_REQUEST', true );
|
||||
// Some browser-embedded clients send cookies. We don't want them.
|
||||
$_COOKIE = array();
|
||||
|
||||
// A bug in PHP < 5.2.2 makes $HTTP_RAW_POST_DATA not set by default,
|
||||
// but we can do it ourself.
|
||||
// $HTTP_RAW_POST_DATA was deprecated in PHP 5.6 and removed in PHP 7.0.
|
||||
// phpcs:disable PHPCompatibility.Variables.RemovedPredefinedGlobalVariables.http_raw_post_dataDeprecatedRemoved
|
||||
if ( ! isset( $HTTP_RAW_POST_DATA ) ) {
|
||||
$HTTP_RAW_POST_DATA = file_get_contents( 'php://input' );
|
||||
}
|
||||
@@ -25,6 +25,7 @@ if ( ! isset( $HTTP_RAW_POST_DATA ) ) {
|
||||
if ( isset( $HTTP_RAW_POST_DATA ) ) {
|
||||
$HTTP_RAW_POST_DATA = trim( $HTTP_RAW_POST_DATA );
|
||||
}
|
||||
// phpcs:enable
|
||||
|
||||
/** Include the bootstrap for setting up WordPress environment */
|
||||
require_once __DIR__ . '/wp-load.php';
|
||||
|
||||
Reference in New Issue
Block a user