WordPress.org

Make WordPress Core

Ticket #10330: xmlrpc.php-2.8-branch.diff

File xmlrpc.php-2.8-branch.diff, 2.1 KB (added by josephscott, 9 years ago)

This includes site_url() changes for the admin context from rev 11679

  • xmlrpc.php

     
    3939    <engineLink>http://wordpress.org/</engineLink>
    4040    <homePageLink><?php bloginfo_rss('url') ?></homePageLink>
    4141    <apis>
    42       <api name="WordPress" blogID="1" preferred="true" apiLink="<?php echo site_url('xmlrpc.php') ?>" />
    43       <api name="Movable Type" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php') ?>" />
    44       <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php') ?>" />
    45       <api name="Blogger" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php') ?>" />
    46       <api name="Atom" blogID="" preferred="false" apiLink="<?php echo apply_filters('atom_service_url', site_url('wp-app.php/service') ) ?>" />
     42      <api name="WordPress" blogID="1" preferred="true" apiLink="<?php echo site_url('xmlrpc.php', 'admin') ?>" />
     43      <api name="Movable Type" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'admin') ?>" />
     44      <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'admin') ?>" />
     45      <api name="Blogger" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'admin') ?>" />
     46      <api name="Atom" blogID="" preferred="false" apiLink="<?php echo apply_filters('atom_service_url', site_url('wp-app.php/service', 'admin') ) ?>" />
    4747    </apis>
    4848  </service>
    4949</rsd>
     
    5757// Turn off all warnings and errors.
    5858// error_reporting(0);
    5959
     60// Redirect to HTTPS if FORCE_SSL_ADMIN or FORCE_SSL_LOGIN is true
     61$secure = false;
     62if ( is_ssl( ) || force_ssl_admin( ) || force_ssl_login( ) )
     63        $secure = true;
     64
     65if ( $secure && !is_ssl( ) ) {
     66        if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
     67                wp_redirect( preg_replace( '|^http://|',  'https://', $_SERVER['REQUEST_URI'] ) );
     68                exit( );
     69        } else {
     70                wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
     71                exit( );
     72        }
     73}
     74
    6075/**
    6176 * Posts submitted via the xmlrpc interface get that title
    6277 * @name post_default_title