sync single and multisite cookie hash, remove extraneous code, See #11644

git-svn-id: http://svn.automattic.com/wordpress/trunk@12771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
wpmuguru 2010-01-20 01:14:05 +00:00
parent aac0a1230a
commit 515d1354da
3 changed files with 10 additions and 16 deletions

View File

@ -687,7 +687,8 @@ Thanks!
--The Team @ SITE_NAME')", $network_id ) ); --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 <a href=\"SITE_URL\">SITE_NAME</a>. This is your first post. Edit or delete it, then start blogging!' )", $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 <a href=\"SITE_URL\">SITE_NAME</a>. 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->domain = $domain;
$current_site->path = $base; $current_site->path = $base;

View File

@ -134,8 +134,13 @@ function wp_default_constants( $context ) {
* Used to guarantee unique hash cookies * Used to guarantee unique hash cookies
* @since 1.5 * @since 1.5
*/ */
if( !defined('COOKIEHASH') ) if ( !defined( 'COOKIEHASH' ) ) {
define('COOKIEHASH', md5(get_option('siteurl'))); $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 * 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 ) {
} }
?> ?>

View File

@ -48,18 +48,6 @@ function ms_network_settings() {
if( $current_site->site_name == false ) if( $current_site->site_name == false )
$current_site->site_name = ucfirst( $current_site->domain ); $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(); $wpdb->hide_errors();
} }