Make WordPress Core


Ignore:
Timestamp:
06/06/2008 07:39:11 AM (18 years ago)
Author:
ryan
Message:

More use of site_url(), admin_url(), and site_url(). Force login and admin links to be https if FORCE_SSL_LOGIN. see #7001

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r8000 r8058  
    751751                        var x=d.selection;
    752752                        var s=(e?e():(k)?k():(x?x.createRange().text:0));
    753                         var f='" . get_settings('siteurl') . '/wp-admin/press-this.php' . "';
     753                        var f='" . admin_url('press-this.php') . "';
    754754                        var l=d.location;
    755755                        var e=encodeURIComponent;
     
    780780function site_url($path = '', $scheme = null) {
    781781        // should the list of allowed schemes be maintained elsewhere?
    782         if ( !in_array($scheme, array('http', 'https')) )
    783                 $scheme = ( is_ssl() ? 'https' : 'http' );
     782        if ( !in_array($scheme, array('http', 'https')) ) {
     783                if ( ('forceable' == $scheme) && (defined('FORCE_SSL_LOGIN') && FORCE_SSL_LOGIN) )
     784                        $scheme = 'https';
     785                else
     786                        $scheme = ( is_ssl() ? 'https' : 'http' );
     787        }
    784788
    785789        $url = str_replace( 'http://', "{$scheme}://", get_option('siteurl') );
     
    794798        global $_wp_admin_url;
    795799
    796         $url = site_url() . '/wp-admin/';
     800        $url = site_url('wp-admin/', 'forceable');
    797801
    798802        if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
Note: See TracChangeset for help on using the changeset viewer.