Make WordPress Core


Ignore:
Timestamp:
02/05/2010 12:45:21 PM (17 years ago)
Author:
dd32
Message:

Simplify https:// conversion in plugins_url()/content_url() functions

File:
1 edited

Legend:

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

    r12963 r12964  
    18391839*/
    18401840function content_url($path = '') {
    1841         $scheme = ( is_ssl() ? 'https' : 'http' );
    18421841        $url = WP_CONTENT_URL;
    1843         if ( 0 === strpos($url, 'http') ) {
    1844                 if ( is_ssl() )
    1845                         $url = str_replace( 'http://', "{$scheme}://", $url );
    1846         }
     1842        if ( 0 === strpos($url, 'http') && is_ssl() )
     1843                $url = str_replace( 'http://', 'https://', $url );
    18471844
    18481845        if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
     
    18641861*/
    18651862function plugins_url($path = '', $plugin = '') {
    1866         $scheme = ( is_ssl() ? 'https' : 'http' );
    18671863
    18681864        $mu_plugin_dir = WPMU_PLUGIN_DIR;
     
    18781874
    18791875        if ( 0 === strpos($url, 'http') && is_ssl() )
    1880                 $url = str_replace( 'http://', "{$scheme}://", $url );
     1876                $url = str_replace( 'http://', 'https://', $url );
    18811877
    18821878        if ( !empty($plugin) && is_string($plugin) ) {
Note: See TracChangeset for help on using the changeset viewer.