Changeset 15648 for trunk/wp-includes/class.wp-xmlrpc-server.php
- Timestamp:
- 09/23/2010 09:38:28 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/class.wp-xmlrpc-server.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class.wp-xmlrpc-server.php
r15647 r15648 5 5 * @package WordPress 6 6 */ 7 8 /**9 * Whether this is a XMLRPC Request10 *11 * @var bool12 */13 define('XMLRPC_REQUEST', true);14 15 // Some browser-embedded clients send cookies. We don't want them.16 $_COOKIE = array();17 18 // A bug in PHP < 5.2.2 makes $HTTP_RAW_POST_DATA not set by default,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 24 // fix for mozBlog and other cases where '<?xml' isn't on the very first line25 if ( isset($HTTP_RAW_POST_DATA) )26 $HTTP_RAW_POST_DATA = trim($HTTP_RAW_POST_DATA);27 28 /** Include the bootstrap for setting up WordPress environment */29 include('./wp-load.php');30 31 if ( isset( $_GET['rsd'] ) ) { // http://archipelago.phrasewise.com/rsd32 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);33 ?>34 <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>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>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') ?>" />45 <api name="Atom" blogID="" preferred="false" apiLink="<?php echo apply_filters('atom_service_url', site_url('wp-app.php/service', 'rpc') ) ?>" />46 </apis>47 </service>48 </rsd>49 <?php50 exit;51 }52 53 include_once(ABSPATH . 'wp-admin/includes/admin.php');54 include_once(ABSPATH . WPINC . '/class-IXR.php');55 56 // Turn off all warnings and errors.57 // error_reporting(0);58 59 /**60 * Posts submitted via the xmlrpc interface get that title61 * @name post_default_title62 * @var string63 */64 $post_default_title = "";65 66 /**67 * Whether to enable XMLRPC Logging.68 *69 * @name xmlrpc_logging70 * @var int|bool71 */72 $xmlrpc_logging = 0;73 74 /**75 * logIO() - Writes logging info to a file.76 *77 * @uses $xmlrpc_logging78 * @package WordPress79 * @subpackage Logging80 *81 * @param string $io Whether input or output82 * @param string $msg Information describing logging reason.83 * @return bool Always return true84 */85 function logIO($io,$msg) {86 global $xmlrpc_logging;87 if ($xmlrpc_logging) {88 $fp = fopen("../xmlrpc.log","a+");89 $date = gmdate("Y-m-d H:i:s ");90 $iot = ($io == "I") ? " Input: " : " Output: ";91 fwrite($fp, "\n\n".$date.$iot.$msg);92 fclose($fp);93 }94 return true;95 }96 97 if ( isset($HTTP_RAW_POST_DATA) )98 logIO("I", $HTTP_RAW_POST_DATA);99 7 100 8 /** … … 3336 3244 } 3337 3245 } 3338 3339 $wp_xmlrpc_server = new wp_xmlrpc_server();3340 $wp_xmlrpc_server->serve_request();3341 3246 ?>
Note: See TracChangeset
for help on using the changeset viewer.