Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,15 @@

// Users with setups where multiple installs share a common wp-config.php or $table_prefix
// can use this to guarantee uniqueness for the keys generated by this object cache
// If WP_CACHE_KEY_SALT is not set, generate a key from DB parameters and blog id
if ( ! defined( 'WP_CACHE_KEY_SALT' ) ) {
define( 'WP_CACHE_KEY_SALT', '' );
if ( defined('DB_NAME') && defined('DB_USER') && defined('DB_PASSWORD') && defined('DB_HOST')) {
global $blog_id, $table_prefix;
define( 'WP_CACHE_KEY_SALT', md5( DB_NAME . ":" . DB_USER . ":" . DB_PASSWORD . ":" . DB_HOST . ":" . $table_prefix . ":" . $blog_id ) );
}
else {
define( 'WP_CACHE_KEY_SALT', '' );
}
}

function wp_cache_add( $key, $data, $group = '', $expire = 0 ) {
Expand Down