diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php index bf200f9498..745f0eea19 100644 --- a/wp-admin/includes/schema.php +++ b/wp-admin/includes/schema.php @@ -687,7 +687,8 @@ Thanks! --The Team @ SITE_NAME')", $network_id ) ); $wpdb->query( $wpdb->prepare( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, %d, 'first_post', 'Welcome to SITE_NAME. This is your first post. Edit or delete it, then start blogging!' )", $network_id ) ); - $weblog_title = stripslashes( $_POST[ 'weblog_title' ] ); + //@todo - network admins should have a method of editing the network siteurl (used for cookie hash) + $wpdb->query( $wpdb->prepare( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, %d, 'siteurl', %s)", $network_id, get_option( 'siteurl' ) ) ); $current_site->domain = $domain; $current_site->path = $base; diff --git a/wp-includes/default-constants.php b/wp-includes/default-constants.php index 6c08068c07..fdb839fdda 100644 --- a/wp-includes/default-constants.php +++ b/wp-includes/default-constants.php @@ -134,8 +134,13 @@ function wp_default_constants( $context ) { * Used to guarantee unique hash cookies * @since 1.5 */ - if( !defined('COOKIEHASH') ) - define('COOKIEHASH', md5(get_option('siteurl'))); + if ( !defined( 'COOKIEHASH' ) ) { + $siteurl = get_site_option( 'siteurl' ); + if ( $siteurl ) + define( 'COOKIEHASH', md5( $siteurl ) ); + else + define( 'COOKIEHASH', '' ); + } /** * Should be exactly the same as the default value of SECRET_KEY in wp-config-sample.php @@ -276,4 +281,4 @@ function wp_default_constants( $context ) { } -?> \ No newline at end of file +?> diff --git a/wp-includes/ms-load.php b/wp-includes/ms-load.php index 77c69b84fc..9d98c17a47 100644 --- a/wp-includes/ms-load.php +++ b/wp-includes/ms-load.php @@ -48,18 +48,6 @@ function ms_network_settings() { if( $current_site->site_name == false ) $current_site->site_name = ucfirst( $current_site->domain ); - if ( ! defined('WP_INSTALLING') ) { - if ( !isset($cookiehash) ) - $cookiehash = ''; - - /** - * Used to guarantee unique hash cookies - * @since 1.5 - */ - if ( !defined('COOKIEHASH') ) - define( 'COOKIEHASH', $cookiehash ); - } - $wpdb->hide_errors(); }