WordPress.org

Make WordPress Core

Ticket #10330: 10330.diff

File 10330.diff, 2.2 KB (added by ryan, 6 years ago)

Add 'rpc' context to siteurl which obeys ADMIN and LOGIN forced SSL

  • wp-includes/link-template.php

     
    16931693        // should the list of allowed schemes be maintained elsewhere? 
    16941694        $orig_scheme = $scheme; 
    16951695        if ( !in_array($scheme, array('http', 'https')) ) { 
    1696                 if ( ('login_post' == $scheme) && ( force_ssl_login() || force_ssl_admin() ) ) 
     1696                if ( ( 'login_post' == $scheme || 'rpc' == $scheme ) && ( force_ssl_login() || force_ssl_admin() ) ) 
    16971697                        $scheme = 'https'; 
    16981698                elseif ( ('login' == $scheme) && ( force_ssl_admin() ) ) 
    16991699                        $scheme = 'https'; 
  • 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', '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') ) ?>" /> 
     42      <api name="WordPress" blogID="1" preferred="true" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" /> 
     43      <api name="Movable Type" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" /> 
     44      <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" /> 
     45      <api name="Blogger" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" /> 
     46      <api name="Atom" blogID="" preferred="false" apiLink="<?php echo apply_filters('atom_service_url', site_url('wp-app.php/service', 'rpc') ) ?>" /> 
    4747    </apis> 
    4848  </service> 
    4949</rsd>