Changeset 8136 for trunk/xmlrpc.php

Show
Ignore:
Timestamp:
06/20/08 15:39:41 (5 months ago)
Author:
ryan
Message:

Disable remote publishing by default. Add options to turn them back on. Props josephscott. see #7157

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/xmlrpc.php

    r8114 r8136  
    4040    <homePageLink><?php bloginfo_rss('url') ?></homePageLink> 
    4141    <apis> 
     42    <?php if ( get_option('enable_xmlrpc') ) :?> 
    4243      <api name="WordPress" blogID="1" preferred="true" apiLink="<?php bloginfo_rss('wpurl') ?>/xmlrpc.php" /> 
    4344      <api name="Movable Type" blogID="1" preferred="false" apiLink="<?php bloginfo_rss('wpurl') ?>/xmlrpc.php" /> 
    4445      <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php bloginfo_rss('wpurl') ?>/xmlrpc.php" /> 
    4546      <api name="Blogger" blogID="1" preferred="false" apiLink="<?php bloginfo_rss('wpurl') ?>/xmlrpc.php" /> 
     47    <?php endif; if ( get_option('enable_app') ) :?> 
    4648      <api name="Atom" blogID="" preferred="false" apiLink="<?php echo apply_filters('atom_service_url', (get_bloginfo('url')."/wp-app.php/service"))?>" /> 
     49    <?php endif; ?> 
    4750    </apis> 
    4851  </service> 
     
    109112 
    110113    function wp_xmlrpc_server() { 
    111         $this->methods = array( 
     114        $xmlrpc_methods = array( 
    112115            // WordPress API 
    113116            'wp.getUsersBlogs'      => 'this:wp_getUsersBlogs', 
     
    165168            'mt.supportedTextFilters' => 'this:mt_supportedTextFilters', 
    166169            'mt.getTrackbackPings' => 'this:mt_getTrackbackPings', 
    167             'mt.publishPost' => 'this:mt_publishPost', 
    168  
     170            'mt.publishPost' => 'this:mt_publishPost' 
     171        ); 
     172         
     173        $xmlrpc_functions = array ( 
    169174            // PingBack 
    170175            'pingback.ping' => 'this:pingback_ping', 
     
    175180        ); 
    176181 
     182        if ( get_option('enable_xmlrpc') ) 
     183        { 
     184            $this->methods = array_merge($xmlrpc_methods,$xmlrpc_functions); 
     185        } else { 
     186            $this->methods = $xmlrpc_functions; 
     187        } 
     188         
    177189        $this->initialise_blog_option_info( ); 
    178190        $this->methods = apply_filters('xmlrpc_methods', $this->methods);