Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 86 lines (74 sloc) 2.788 kb
012077c work in progress: replacement for xmlrpc.php, using IXR
michelvaldrighi authored
1 <?php
7629b13 File file level phpdoc from jacobsantos. see #7037
ryan authored
2 /**
3 * XML-RPC protocol support for WordPress
4 *
5 * @package WordPress
6 */
7
8 /**
9 * Whether this is a XMLRPC Request
10 *
11 * @var bool
12 */
002cb47 Make the xmlrpc user the current user. fixes #2273
ryan authored
13 define('XMLRPC_REQUEST', true);
14
15 // Some browser-embedded clients send cookies. We don't want them.
16 $_COOKIE = array();
17
9c86ec3 Remove trailing whitespace
ryan authored
18 // A bug in PHP < 5.2.2 makes $HTTP_RAW_POST_DATA not set by default,
2c31ed5 Fix for PHP version 5.2.2 where $HTTP_RAW_POST_DATA isn't set. fixes …
rob1n authored
19 // but we can do it ourself.
20 if ( !isset( $HTTP_RAW_POST_DATA ) ) {
21 $HTTP_RAW_POST_DATA = file_get_contents( 'php://input' );
22 }
23
7629b13 File file level phpdoc from jacobsantos. see #7037
ryan authored
24 // fix for mozBlog and other cases where '<?xml' isn't on the very first line
fac9d11 Check if HTTP_RAW_POST_DATA is set to avoid undefined var warning. P…
ryan authored
25 if ( isset($HTTP_RAW_POST_DATA) )
26 $HTTP_RAW_POST_DATA = trim($HTTP_RAW_POST_DATA);
012077c work in progress: replacement for xmlrpc.php, using IXR
michelvaldrighi authored
27
7629b13 File file level phpdoc from jacobsantos. see #7037
ryan authored
28 /** Include the bootstrap for setting up WordPress environment */
94ca99e Allow wp-config.php to exist one level up from WordPress root directo…
ryan authored
29 include('./wp-load.php');
5d739e2 Add RSD support. See http://archipelago.phrasewise.com/rsd
matt authored
30
9c86ec3 Remove trailing whitespace
ryan authored
31 if ( isset( $_GET['rsd'] ) ) { // http://archipelago.phrasewise.com/rsd
6affb4f Content-Type, not Content-type, as headers are case sensitive. Props …
rob1n authored
32 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
5d739e2 Add RSD support. See http://archipelago.phrasewise.com/rsd
matt authored
33 ?>
a3fd544 Use get_option instead of get_settings. Just 'cause.
ryan authored
34 <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
5d739e2 Add RSD support. See http://archipelago.phrasewise.com/rsd
matt authored
35 <rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
36 <service>
37 <engineName>WordPress</engineName>
38 <engineLink>http://wordpress.org/</engineLink>
39 <homePageLink><?php bloginfo_rss('url') ?></homePageLink>
40 <apis>
c69d5ec Add 'rpc' context to siteurl which obeys ADMIN and LOGIN forced SSL. …
ryan authored
41 <api name="WordPress" blogID="1" preferred="true" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
42 <api name="Movable Type" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
43 <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
44 <api name="Blogger" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
6769bfb Don't do SSL discovery for every RSD request. APP endpoint already re…
westi authored
45 <api name="Atom" blogID="" preferred="false" apiLink="<?php echo site_url('wp-app.php/service', 'rpc') ?>" />
5d739e2 Add RSD support. See http://archipelago.phrasewise.com/rsd
matt authored
46 </apis>
47 </service>
48 </rsd>
49 <?php
50 exit;
51 }
52
d0f8fa2 Admin includes reorg. see #4334
ryan authored
53 include_once(ABSPATH . 'wp-admin/includes/admin.php');
759d692 big oopsie related to moving the xmlrpc.php file: somehow it got repl…
michelvaldrighi authored
54 include_once(ABSPATH . WPINC . '/class-IXR.php');
25fda52 Rename new classes to match our coding standards. Fixes #15280.
westi authored
55 include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');
012077c work in progress: replacement for xmlrpc.php, using IXR
michelvaldrighi authored
56
7629b13 File file level phpdoc from jacobsantos. see #7037
ryan authored
57 /**
58 * Posts submitted via the xmlrpc interface get that title
59 * @name post_default_title
60 * @var string
61 */
62 $post_default_title = "";
63
a59facd Deprecate ancient "debugging" tools.
nacin authored
64 // Allow for a plugin to insert a different class to handle requests.
65 $wp_xmlrpc_server_class = apply_filters('wp_xmlrpc_server_class', 'wp_xmlrpc_server');
66 $wp_xmlrpc_server = new $wp_xmlrpc_server_class;
67
68 // Fire off the request
69 $wp_xmlrpc_server->serve_request();
70
71 exit;
012077c work in progress: replacement for xmlrpc.php, using IXR
michelvaldrighi authored
72
7629b13 File file level phpdoc from jacobsantos. see #7037
ryan authored
73 /**
74 * logIO() - Writes logging info to a file.
75 *
a59facd Deprecate ancient "debugging" tools.
nacin authored
76 * @deprecated 3.4.0
77 * @deprecated Use error_log()
7629b13 File file level phpdoc from jacobsantos. see #7037
ryan authored
78 *
79 * @param string $io Whether input or output
80 * @param string $msg Information describing logging reason.
81 */
a59facd Deprecate ancient "debugging" tools.
nacin authored
82 function logIO( $io, $msg ) {
83 _deprecated_function( __FUNCTION__, '3.4', 'error_log()' );
84 if ( ! empty( $GLOBALS['xmlrpc_logging'] ) )
85 error_log( $io . ' - ' . $msg );
86 }
Something went wrong with that request. Please try again.