Changeset 42343 for trunk/src/xmlrpc.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/src/xmlrpc.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/xmlrpc.php
r42228 r42343 11 11 * @var bool 12 12 */ 13 define( 'XMLRPC_REQUEST', true);13 define( 'XMLRPC_REQUEST', true ); 14 14 15 15 // Some browser-embedded clients send cookies. We don't want them. … … 18 18 // A bug in PHP < 5.2.2 makes $HTTP_RAW_POST_DATA not set by default, 19 19 // but we can do it ourself. 20 if ( ! isset( $HTTP_RAW_POST_DATA ) ) {20 if ( ! isset( $HTTP_RAW_POST_DATA ) ) { 21 21 $HTTP_RAW_POST_DATA = file_get_contents( 'php://input' ); 22 22 } 23 23 24 24 // fix for mozBlog and other cases where '<?xml' isn't on the very first line 25 if ( isset($HTTP_RAW_POST_DATA) ) 26 $HTTP_RAW_POST_DATA = trim($HTTP_RAW_POST_DATA); 25 if ( isset( $HTTP_RAW_POST_DATA ) ) { 26 $HTTP_RAW_POST_DATA = trim( $HTTP_RAW_POST_DATA ); 27 } 27 28 28 29 /** Include the bootstrap for setting up WordPress environment */ … … 30 31 31 32 if ( isset( $_GET['rsd'] ) ) { // http://cyber.law.harvard.edu/blogs/gems/tech/rsd.html 32 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);33 header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true ); 33 34 ?> 34 <?php echo '<?xml version="1.0" encoding="' .get_option('blog_charset').'"?'.'>'; ?>35 <?php echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>'; ?> 35 36 <rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd"> 36 37 <service> 37 38 <engineName>WordPress</engineName> 38 39 <engineLink>https://wordpress.org/</engineLink> 39 <homePageLink><?php bloginfo_rss( 'url')?></homePageLink>40 <homePageLink><?php bloginfo_rss( 'url' ); ?></homePageLink> 40 41 <apis> 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')?>" />42 <api name="WordPress" blogID="1" preferred="true" apiLink="<?php echo site_url( 'xmlrpc.php', 'rpc' ); ?>" /> 43 <api name="Movable Type" blogID="1" preferred="false" apiLink="<?php echo site_url( 'xmlrpc.php', 'rpc' ); ?>" /> 44 <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php echo site_url( 'xmlrpc.php', 'rpc' ); ?>" /> 45 <api name="Blogger" blogID="1" preferred="false" apiLink="<?php echo site_url( 'xmlrpc.php', 'rpc' ); ?>" /> 45 46 <?php 46 47 /** … … 60 61 } 61 62 62 include_once( ABSPATH . 'wp-admin/includes/admin.php');63 include_once( ABSPATH . WPINC . '/class-IXR.php');64 include_once( ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');63 include_once( ABSPATH . 'wp-admin/includes/admin.php' ); 64 include_once( ABSPATH . WPINC . '/class-IXR.php' ); 65 include_once( ABSPATH . WPINC . '/class-wp-xmlrpc-server.php' ); 65 66 66 67 /** 67 68 * Posts submitted via the XML-RPC interface get that title 69 * 68 70 * @name post_default_title 69 71 * @var string 70 72 */ 71 $post_default_title = "";73 $post_default_title = ''; 72 74 73 75 /** … … 79 81 */ 80 82 $wp_xmlrpc_server_class = apply_filters( 'wp_xmlrpc_server_class', 'wp_xmlrpc_server' ); 81 $wp_xmlrpc_server = new $wp_xmlrpc_server_class;83 $wp_xmlrpc_server = new $wp_xmlrpc_server_class; 82 84 83 85 // Fire off the request … … 97 99 function logIO( $io, $msg ) { 98 100 _deprecated_function( __FUNCTION__, '3.4.0', 'error_log()' ); 99 if ( ! empty( $GLOBALS['xmlrpc_logging'] ) ) 101 if ( ! empty( $GLOBALS['xmlrpc_logging'] ) ) { 100 102 error_log( $io . ' - ' . $msg ); 103 } 101 104 }
Note: See TracChangeset
for help on using the changeset viewer.