Make WordPress Core

Changeset 5394


Ignore:
Timestamp:
05/05/2007 12:17:05 AM (20 years ago)
Author:
rob1n
Message:

Use WP_HOME and WP_SITEURL in upgrading. Props filosofo. fixes #4211

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/wp-admin/upgrade-functions.php

    r5345 r5394  
    660660function __get_option($setting) {
    661661        global $wpdb;
    662 
     662       
     663        if ( $setting == 'home' && defined( 'WP_HOME' ) ) {
     664                return preg_replace( '|/+$|', '', constant( 'WP_HOME' ) );
     665        }
     666       
     667        if ( $setting == 'siteurl' && defined( 'WP_SITEURL' ) ) {
     668                return preg_replace( '|/+$|', '', constant( 'WP_SITEURL' ) );
     669        }
     670       
    663671        $option = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'");
    664672
  • trunk/wp-admin/upgrade-functions.php

    r5345 r5394  
    672672function __get_option($setting) {
    673673        global $wpdb;
    674 
     674       
     675        if ( $setting == 'home' && defined( 'WP_HOME' ) ) {
     676                return preg_replace( '|/+$|', '', constant( 'WP_HOME' ) );
     677        }
     678       
     679        if ( $setting == 'siteurl' && defined( 'WP_SITEURL' ) ) {
     680                return preg_replace( '|/+$|', '', constant( 'WP_SITEURL' ) );
     681        }
     682       
    675683        $option = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'");
    676684
Note: See TracChangeset for help on using the changeset viewer.