2013-10-25 00:58:23 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* XML-RPC protocol support for WordPress
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether this is an XML-RPC Request
|
|
|
|
*
|
|
|
|
* @var bool
|
|
|
|
*/
|
2017-12-01 00:11:00 +01:00
|
|
|
define( 'XMLRPC_REQUEST', true );
|
2013-10-25 00:58:23 +02:00
|
|
|
|
Docs: Revise comments using “we” in WordPress root directory files.
This updates some inline comments to better match the guidelines and recommendations set forth in the make/core and make/docs handbooks:
> In general, use second person in your documentation. Second person depicts a friendly tone, with a perfect focus on the reader. In addition to this, directly addressing the reader helps avoid passive voice; thereby preventing unwanted confusion.
> ...
> the word “we” should be avoided (...) unless its made very clear which group is speaking.
Includes:
* Replacing first-person usage of "we" with second person point of view.
* Making small clarification adjustments where the voice is much too casual or lacks clear context, especially for non-native English speakers.
References:
* [https://make.wordpress.org/docs/style-guide/language-grammar/grammatical-person/ Style Guide: Grammatical person]
* [https://make.wordpress.org/docs/handbook/documentation-team-handbook/handbooks-style-and-formatting-guide/ Handbooks & HelpHub Style and Formatting Guide]
* [https://make.wordpress.org/core/handbook/best-practices/post-comment-guidelines/#style-and-substance Post & Comment Guidelines: Style and Substance]
Follow-up to [2176], [3430], [4676], [6009], [7991], [12688], [12762], [26008], [28978], [44488], [44962], [51979], [53131], [53132], [53156], [53131], [54200].
Props ironprogrammer, costdev, jorbin, SergeyBiryukov.
See #57052.
Built from https://develop.svn.wordpress.org/trunk@54866
git-svn-id: http://core.svn.wordpress.org/trunk@54418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-23 16:43:13 +01:00
|
|
|
// Discard unneeded cookies sent by some browser-embedded clients.
|
2013-10-25 00:58:23 +02:00
|
|
|
$_COOKIE = array();
|
|
|
|
|
2020-06-08 21:55:10 +02:00
|
|
|
// $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
|
2017-12-01 00:11:00 +01:00
|
|
|
if ( ! isset( $HTTP_RAW_POST_DATA ) ) {
|
2013-10-25 00:58:23 +02:00
|
|
|
$HTTP_RAW_POST_DATA = file_get_contents( 'php://input' );
|
|
|
|
}
|
|
|
|
|
2020-01-29 01:45:18 +01:00
|
|
|
// Fix for mozBlog and other cases where '<?xml' isn't on the very first line.
|
2017-12-01 00:11:00 +01:00
|
|
|
if ( isset( $HTTP_RAW_POST_DATA ) ) {
|
|
|
|
$HTTP_RAW_POST_DATA = trim( $HTTP_RAW_POST_DATA );
|
|
|
|
}
|
2020-06-08 21:55:10 +02:00
|
|
|
// phpcs:enable
|
2013-10-25 00:58:23 +02:00
|
|
|
|
|
|
|
/** Include the bootstrap for setting up WordPress environment */
|
2020-02-06 07:33:11 +01:00
|
|
|
require_once __DIR__ . '/wp-load.php';
|
2013-10-25 00:58:23 +02:00
|
|
|
|
|
|
|
if ( isset( $_GET['rsd'] ) ) { // http://cyber.law.harvard.edu/blogs/gems/tech/rsd.html
|
2017-12-01 00:11:00 +01:00
|
|
|
header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
|
2018-08-15 08:22:26 +02:00
|
|
|
echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>';
|
|
|
|
?>
|
2013-10-25 00:58:23 +02:00
|
|
|
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
|
2017-11-27 00:57:55 +01:00
|
|
|
<service>
|
|
|
|
<engineName>WordPress</engineName>
|
|
|
|
<engineLink>https://wordpress.org/</engineLink>
|
2017-12-01 00:11:00 +01:00
|
|
|
<homePageLink><?php bloginfo_rss( 'url' ); ?></homePageLink>
|
2017-11-27 00:57:55 +01:00
|
|
|
<apis>
|
2017-12-01 00:11:00 +01:00
|
|
|
<api name="WordPress" blogID="1" preferred="true" apiLink="<?php echo site_url( 'xmlrpc.php', 'rpc' ); ?>" />
|
|
|
|
<api name="Movable Type" blogID="1" preferred="false" apiLink="<?php echo site_url( 'xmlrpc.php', 'rpc' ); ?>" />
|
|
|
|
<api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php echo site_url( 'xmlrpc.php', 'rpc' ); ?>" />
|
|
|
|
<api name="Blogger" blogID="1" preferred="false" apiLink="<?php echo site_url( 'xmlrpc.php', 'rpc' ); ?>" />
|
2017-11-27 00:57:55 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Add additional APIs to the Really Simple Discovery (RSD) endpoint.
|
|
|
|
*
|
|
|
|
* @link http://cyber.law.harvard.edu/blogs/gems/tech/rsd.html
|
|
|
|
*
|
|
|
|
* @since 3.5.0
|
|
|
|
*/
|
|
|
|
do_action( 'xmlrpc_rsd_apis' );
|
|
|
|
?>
|
|
|
|
</apis>
|
|
|
|
</service>
|
2013-10-25 00:58:23 +02:00
|
|
|
</rsd>
|
2018-08-17 03:51:36 +02:00
|
|
|
<?php
|
|
|
|
exit;
|
2013-10-25 00:58:23 +02:00
|
|
|
}
|
|
|
|
|
2020-02-06 07:33:11 +01:00
|
|
|
require_once ABSPATH . 'wp-admin/includes/admin.php';
|
|
|
|
require_once ABSPATH . WPINC . '/class-IXR.php';
|
|
|
|
require_once ABSPATH . WPINC . '/class-wp-xmlrpc-server.php';
|
2013-10-25 00:58:23 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Posts submitted via the XML-RPC interface get that title
|
2017-12-01 00:11:00 +01:00
|
|
|
*
|
2013-10-25 00:58:23 +02:00
|
|
|
* @name post_default_title
|
|
|
|
* @var string
|
|
|
|
*/
|
2017-12-01 00:11:00 +01:00
|
|
|
$post_default_title = '';
|
2013-10-25 00:58:23 +02:00
|
|
|
|
2013-10-25 04:29:52 +02:00
|
|
|
/**
|
2016-05-23 18:44:27 +02:00
|
|
|
* Filters the class used for handling XML-RPC requests.
|
2013-10-25 04:29:52 +02:00
|
|
|
*
|
2013-10-25 00:58:23 +02:00
|
|
|
* @since 3.1.0
|
2014-02-09 21:39:12 +01:00
|
|
|
*
|
|
|
|
* @param string $class The name of the XML-RPC server class.
|
2013-10-25 04:29:52 +02:00
|
|
|
*/
|
2013-10-25 00:58:23 +02:00
|
|
|
$wp_xmlrpc_server_class = apply_filters( 'wp_xmlrpc_server_class', 'wp_xmlrpc_server' );
|
2017-12-01 00:11:00 +01:00
|
|
|
$wp_xmlrpc_server = new $wp_xmlrpc_server_class;
|
2013-10-25 00:58:23 +02:00
|
|
|
|
2020-01-29 01:45:18 +01:00
|
|
|
// Fire off the request.
|
2013-10-25 00:58:23 +02:00
|
|
|
$wp_xmlrpc_server->serve_request();
|
|
|
|
|
|
|
|
exit;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* logIO() - Writes logging info to a file.
|
|
|
|
*
|
2015-08-21 00:44:25 +02:00
|
|
|
* @deprecated 3.4.0 Use error_log()
|
|
|
|
* @see error_log()
|
2013-10-25 00:58:23 +02:00
|
|
|
*
|
|
|
|
* @param string $io Whether input or output
|
|
|
|
* @param string $msg Information describing logging reason.
|
|
|
|
*/
|
2019-07-01 10:01:57 +02:00
|
|
|
function logIO( $io, $msg ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
|
2016-07-06 14:40:29 +02:00
|
|
|
_deprecated_function( __FUNCTION__, '3.4.0', 'error_log()' );
|
2017-12-01 00:11:00 +01:00
|
|
|
if ( ! empty( $GLOBALS['xmlrpc_logging'] ) ) {
|
2013-10-25 00:58:23 +02:00
|
|
|
error_log( $io . ' - ' . $msg );
|
2017-12-01 00:11:00 +01:00
|
|
|
}
|
|
|
|
}
|