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:
parent
aac0a1230a
commit
515d1354da
|
@ -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;
|
||||
|
|
|
@ -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 ) {
|
|||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue