wp/xmlrpc.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 21 48c4eec2b7e6
--- a/wp/xmlrpc.php	Tue Oct 22 16:11:46 2019 +0200
+++ b/wp/xmlrpc.php	Tue Dec 15 13:49:49 2020 +0100
@@ -15,19 +15,20 @@
 // 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' );
 }
 
-// fix for mozBlog and other cases where '<?xml' isn't on the very first line
+// Fix for mozBlog and other cases where '<?xml' isn't on the very first line.
 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 */
-include( dirname( __FILE__ ) . '/wp-load.php' );
+require_once __DIR__ . '/wp-load.php';
 
 if ( isset( $_GET['rsd'] ) ) { // http://cyber.law.harvard.edu/blogs/gems/tech/rsd.html
 	header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
@@ -60,9 +61,9 @@
 	exit;
 }
 
-include_once( ABSPATH . 'wp-admin/includes/admin.php' );
-include_once( ABSPATH . WPINC . '/class-IXR.php' );
-include_once( ABSPATH . WPINC . '/class-wp-xmlrpc-server.php' );
+require_once ABSPATH . 'wp-admin/includes/admin.php';
+require_once ABSPATH . WPINC . '/class-IXR.php';
+require_once ABSPATH . WPINC . '/class-wp-xmlrpc-server.php';
 
 /**
  * Posts submitted via the XML-RPC interface get that title
@@ -82,7 +83,7 @@
 $wp_xmlrpc_server_class = apply_filters( 'wp_xmlrpc_server_class', 'wp_xmlrpc_server' );
 $wp_xmlrpc_server       = new $wp_xmlrpc_server_class;
 
-// Fire off the request
+// Fire off the request.
 $wp_xmlrpc_server->serve_request();
 
 exit;
@@ -96,7 +97,7 @@
  * @param string $io Whether input or output
  * @param string $msg Information describing logging reason.
  */
-function logIO( $io, $msg ) {
+function logIO( $io, $msg ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
 	_deprecated_function( __FUNCTION__, '3.4.0', 'error_log()' );
 	if ( ! empty( $GLOBALS['xmlrpc_logging'] ) ) {
 		error_log( $io . ' - ' . $msg );