wp/xmlrpc.php
changeset 7 cf61fcea0001
parent 5 5e2f62d02dcd
child 9 177826044cd9
equal deleted inserted replaced
6:490d5cc509ed 7:cf61fcea0001
    24 // fix for mozBlog and other cases where '<?xml' isn't on the very first line
    24 // fix for mozBlog and other cases where '<?xml' isn't on the very first line
    25 if ( isset($HTTP_RAW_POST_DATA) )
    25 if ( isset($HTTP_RAW_POST_DATA) )
    26 	$HTTP_RAW_POST_DATA = trim($HTTP_RAW_POST_DATA);
    26 	$HTTP_RAW_POST_DATA = trim($HTTP_RAW_POST_DATA);
    27 
    27 
    28 /** Include the bootstrap for setting up WordPress environment */
    28 /** Include the bootstrap for setting up WordPress environment */
    29 include('./wp-load.php');
    29 include( dirname( __FILE__ ) . '/wp-load.php' );
    30 
    30 
    31 if ( isset( $_GET['rsd'] ) ) { // http://cyber.law.harvard.edu/blogs/gems/tech/rsd.html
    31 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);
    32 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
    33 ?>
    33 ?>
    34 <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
    34 <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
    35 <rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
    35 <rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
    36   <service>
    36   <service>
    37     <engineName>WordPress</engineName>
    37     <engineName>WordPress</engineName>
    38     <engineLink>http://wordpress.org/</engineLink>
    38     <engineLink>https://wordpress.org/</engineLink>
    39     <homePageLink><?php bloginfo_rss('url') ?></homePageLink>
    39     <homePageLink><?php bloginfo_rss('url') ?></homePageLink>
    40     <apis>
    40     <apis>
    41       <api name="WordPress" blogID="1" preferred="true" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
    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') ?>" />
    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') ?>" />
    43       <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
    59 exit;
    59 exit;
    60 }
    60 }
    61 
    61 
    62 include_once(ABSPATH . 'wp-admin/includes/admin.php');
    62 include_once(ABSPATH . 'wp-admin/includes/admin.php');
    63 include_once(ABSPATH . WPINC . '/class-IXR.php');
    63 include_once(ABSPATH . WPINC . '/class-IXR.php');
    64 include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');
    64 include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php'); 
    65 
    65 
    66 /**
    66 /**
    67  * Posts submitted via the XML-RPC interface get that title
    67  * Posts submitted via the XML-RPC interface get that title
    68  * @name post_default_title
    68  * @name post_default_title
    69  * @var string
    69  * @var string
    70  */
    70  */
    71 $post_default_title = "";
    71 $post_default_title = "";
    72 
    72 
    73 /**
    73 /**
    74  * Filter the class used for handling XML-RPC requests.
    74  * Filters the class used for handling XML-RPC requests.
    75  *
    75  *
    76  * @since 3.1.0
    76  * @since 3.1.0
    77  *
    77  *
    78  * @param string $class The name of the XML-RPC server class.
    78  * @param string $class The name of the XML-RPC server class.
    79  */
    79  */
    86 exit;
    86 exit;
    87 
    87 
    88 /**
    88 /**
    89  * logIO() - Writes logging info to a file.
    89  * logIO() - Writes logging info to a file.
    90  *
    90  *
    91  * @deprecated 3.4.0
    91  * @deprecated 3.4.0 Use error_log()
    92  * @deprecated Use error_log()
    92  * @see error_log()
    93  *
    93  *
    94  * @param string $io Whether input or output
    94  * @param string $io Whether input or output
    95  * @param string $msg Information describing logging reason.
    95  * @param string $msg Information describing logging reason.
    96  */
    96  */
    97 function logIO( $io, $msg ) {
    97 function logIO( $io, $msg ) {
    98 	_deprecated_function( __FUNCTION__, '3.4', 'error_log()' );
    98 	_deprecated_function( __FUNCTION__, '3.4.0', 'error_log()' );
    99 	if ( ! empty( $GLOBALS['xmlrpc_logging'] ) )
    99 	if ( ! empty( $GLOBALS['xmlrpc_logging'] ) )
   100 		error_log( $io . ' - ' . $msg );
   100 		error_log( $io . ' - ' . $msg );
   101 }
   101 }