From 69f36791f193748a95eed6aeda715ea9159a5042 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: http://svn.automattic.com/wordpress/trunk@5394 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 85a1cc478..42c47e263 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 )