WordPress.org

Make WordPress Core

Changeset 8182


Ignore:
Timestamp:
06/24/08 17:36:21 (6 years ago)
Author:
ryan
Message:

wp_guess_url() and install styling fixes from sambauers. fixes #7129 see #4732

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/schema.php

    r8136 r8182  
    154154function populate_options() { 
    155155    global $wpdb, $wp_db_version; 
    156  
    157     $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; 
    158     $guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 
     156     
     157    $guessurl = wp_guess_url(); 
    159158     
    160159    do_action('populate_options'); 
  • trunk/wp-admin/includes/upgrade.php

    r8139 r8182  
    2222    update_option('enable_xmlrpc',$remote); 
    2323 
    24     $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; 
    25  
    26     if ( defined('WP_SITEURL') && '' != WP_SITEURL ) 
    27         $guessurl = WP_SITEURL; 
    28     else 
    29         $guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 
     24    $guessurl = wp_guess_url(); 
    3025 
    3126    update_option('siteurl', $guessurl); 
  • trunk/wp-includes/functions.php

    r8100 r8182  
    21272127} 
    21282128 
     2129function wp_guess_url() { 
     2130    if ( defined('WP_SITEURL') && '' != WP_SITEURL ) { 
     2131        $url = WP_SITEURL; 
     2132    } else { 
     2133        $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; 
     2134        $url = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 
     2135    } 
     2136    return $url; 
     2137} 
     2138 
    21292139?> 
  • trunk/wp-includes/script-loader.php

    r8177 r8182  
    88 
    99function wp_default_scripts( &$scripts ) { 
    10     $scripts->base_url = site_url(); 
     10    if (!$guessurl = site_url()) 
     11        $guessurl = wp_guess_url(); 
     12    $scripts->base_url = $guessurl; 
    1113    $scripts->default_version = get_bloginfo( 'version' ); 
    1214 
     
    204206 
    205207function wp_default_styles( &$styles ) { 
    206     $styles->base_url = site_url(); 
     208    if (!$guessurl = site_url()) 
     209        $guessurl = wp_guess_url(); 
     210    $styles->base_url = $guessurl; 
    207211    $styles->default_version = get_bloginfo( 'version' ); 
    208212    $styles->text_direction = 'rtl' == get_bloginfo( 'text_direction' ) ? 'rtl' : 'ltr'; 
Note: See TracChangeset for help on using the changeset viewer.