WordPress.org

Make WordPress Core

Ticket #21509: 21509.patch

File 21509.patch, 4.5 KB (added by markoheijnen, 6 years ago)

Removing the option enable_xmlrpc

  • wp-includes/version.php

     
    1111 *
    1212 * @global int $wp_db_version
    1313 */
    14 $wp_db_version = 21501;
     14$wp_db_version = 21530;
    1515
    1616/**
    1717 * Holds the TinyMCE version
  • wp-includes/class-wp-xmlrpc-server.php

     
    169169         * @see wp_xmlrpc_server::login
    170170         */
    171171        function login_pass_ok($user_login, $user_pass) {
    172                 if ( !get_option( 'enable_xmlrpc' ) ) {
    173                         $this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this site. An admin user can enable them at %s'),  admin_url('options-writing.php') ) );
    174                         return false;
    175                 }
    176 
    177172                if (!user_pass_ok($user_login, $user_pass)) {
    178173                        $this->error = new IXR_Error(403, __('Bad login/pass combination.'));
    179174                        return false;
     
    191186         * @return mixed WP_User object if authentication passed, false otherwise
    192187         */
    193188        function login($username, $password) {
    194                 if ( !get_option( 'enable_xmlrpc' ) ) {
    195                         $this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this site. An admin user can enable them at %s'),  admin_url('options-writing.php') ) );
    196                         return false;
    197                 }
    198 
    199189                $user = wp_authenticate($username, $password);
    200190
    201191                if (is_wp_error($user)) {
  • wp-admin/includes/upgrade.php

     
    399399        if ( $wp_current_db_version < 20080 )
    400400                upgrade_340();
    401401
    402         if ( $wp_current_db_version < 21501 )
     402        if ( $wp_current_db_version < 21530 )
    403403                upgrade_350();
    404404
    405405        maybe_disable_automattic_widgets();
     
    11941194
    11951195        if ( $wp_current_db_version < 21501 && $wpdb->get_var( "SELECT link_id FROM $wpdb->links LIMIT 1" ) )
    11961196                update_option( 'link_manager_enabled', 1 ); // Previously set to 0 by populate_options()
     1197
     1198        if ( $wp_current_db_version < 21530 )
     1199                delete_option( 'enable_xmlrpc' );
    11971200}
    11981201
    11991202/**
  • wp-admin/includes/schema.php

     
    445445        // 2.6
    446446        'avatar_default' => 'mystery',
    447447        'enable_app' => 0,
    448         'enable_xmlrpc' => 0,
    449448
    450449        // 2.7
    451450        'large_size_w' => 1024,
  • wp-admin/options.php

     
    6464        'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type', 'embed_autourls', 'embed_size_w', 'embed_size_h' ),
    6565        'privacy' => array( 'blog_public' ),
    6666        'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'blog_charset', 'show_on_front', 'page_on_front', 'page_for_posts' ),
    67         'writing' => array( 'default_post_edit_rows', 'use_smilies', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'default_post_format', 'enable_app', 'enable_xmlrpc' ),
     67        'writing' => array( 'default_post_edit_rows', 'use_smilies', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'default_post_format', 'enable_app' ),
    6868        'options' => array( '' ) );
    6969
    7070$mail_options = array('mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass');
  • wp-admin/options-writing.php

     
    179179<?php _e('Enable the Atom Publishing Protocol.') ?></label><br />
    180180</fieldset></td>
    181181</tr>
    182 <tr valign="top">
    183 <th scope="row"><?php _e('XML-RPC') ?></th>
    184 <td><fieldset><legend class="screen-reader-text"><span><?php _e('XML-RPC') ?></span></legend>
    185 <label for="enable_xmlrpc">
    186 <input name="enable_xmlrpc" type="checkbox" id="enable_xmlrpc" value="1" <?php checked('1', get_option('enable_xmlrpc')); ?> />
    187 <?php _e('Enable the WordPress, Movable Type, MetaWeblog and Blogger XML-RPC publishing protocols.') ?></label><br />
    188 </fieldset></td>
    189 </tr>
    190182<?php do_settings_fields('writing', 'remote_publishing'); ?>
    191183</table>
    192184