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

git-svn-id: https://develop.svn.wordpress.org/trunk@12771 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ron Rennick 2010-01-20 01:14:05 +00:00
parent 21c4d151e2
commit a5d7344d4f
3 changed files with 10 additions and 16 deletions

View File

@ -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 <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->path = $base;

View File

@ -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 ) {
}
?>
?>

View File

@ -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();
}