From 8653896af0ef889d1bf1e73332726aa8555d12cb Mon Sep 17 00:00:00 2001 From: rob1n Date: Sat, 5 May 2007 00:17:05 +0000 Subject: [PATCH] Use WP_HOME and WP_SITEURL in upgrading. Props filosofo. fixes #4211 git-svn-id: https://develop.svn.wordpress.org/trunk@5394 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/upgrade-functions.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wp-admin/upgrade-functions.php b/wp-admin/upgrade-functions.php index 85a1cc478b..42c47e2638 100644 --- a/wp-admin/upgrade-functions.php +++ b/wp-admin/upgrade-functions.php @@ -671,7 +671,15 @@ function get_alloptions_110() { // Version of get_option that is private to install/upgrade. function __get_option($setting) { global $wpdb; - + + if ( $setting == 'home' && defined( 'WP_HOME' ) ) { + return preg_replace( '|/+$|', '', constant( 'WP_HOME' ) ); + } + + if ( $setting == 'siteurl' && defined( 'WP_SITEURL' ) ) { + return preg_replace( '|/+$|', '', constant( 'WP_SITEURL' ) ); + } + $option = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'"); if ( 'home' == $setting && '' == $option )