Add 'rpc' context to siteurl which obeys ADMIN and LOGIN forced SSL. see #10330 for 2.8.1

git-svn-id: http://svn.automattic.com/wordpress/branches/2.8@11687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-07-04 02:49:44 +00:00
parent 617b650b27
commit 3d8c9363a0
2 changed files with 6 additions and 6 deletions

View File

@ -1693,7 +1693,7 @@ function site_url($path = '', $scheme = null) {
// should the list of allowed schemes be maintained elsewhere? // should the list of allowed schemes be maintained elsewhere?
$orig_scheme = $scheme; $orig_scheme = $scheme;
if ( !in_array($scheme, array('http', 'https')) ) { if ( !in_array($scheme, array('http', 'https')) ) {
if ( ('login_post' == $scheme) && ( force_ssl_login() || force_ssl_admin() ) ) if ( ( 'login_post' == $scheme || 'rpc' == $scheme ) && ( force_ssl_login() || force_ssl_admin() ) )
$scheme = 'https'; $scheme = 'https';
elseif ( ('login' == $scheme) && ( force_ssl_admin() ) ) elseif ( ('login' == $scheme) && ( force_ssl_admin() ) )
$scheme = 'https'; $scheme = 'https';

View File

@ -39,11 +39,11 @@ header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
<engineLink>http://wordpress.org/</engineLink> <engineLink>http://wordpress.org/</engineLink>
<homePageLink><?php bloginfo_rss('url') ?></homePageLink> <homePageLink><?php bloginfo_rss('url') ?></homePageLink>
<apis> <apis>
<api name="WordPress" blogID="1" preferred="true" apiLink="<?php echo site_url('xmlrpc.php') ?>" /> <api name="WordPress" blogID="1" preferred="true" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
<api name="Movable Type" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php') ?>" /> <api name="Movable Type" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
<api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php') ?>" /> <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
<api name="Blogger" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php') ?>" /> <api name="Blogger" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
<api name="Atom" blogID="" preferred="false" apiLink="<?php echo apply_filters('atom_service_url', site_url('wp-app.php/service') ) ?>" /> <api name="Atom" blogID="" preferred="false" apiLink="<?php echo apply_filters('atom_service_url', site_url('wp-app.php/service', 'rpc') ) ?>" />
</apis> </apis>
</service> </service>
</rsd> </rsd>