Changeset 3811
- Timestamp:
- 05/31/2006 01:40:00 AM (20 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
-
cache.php (modified) (4 diffs)
-
pluggable-functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/cache.php
r3810 r3811 65 65 var $warm_cache_hits = 0; 66 66 var $cache_misses = 0; 67 var $secret = ''; 67 68 68 69 function acquire_lock() { … … 175 176 176 177 function hash($data) { 177 global $wp_server_secret;178 if ( empty($wp_server_secret) )179 $wp_server_secret = DB_PASSWORD;180 181 178 if ( function_exists('hash_hmac') ) { 182 return hash_hmac('md5', $data, $ wp_server_secret);179 return hash_hmac('md5', $data, $this->secret); 183 180 } else { 184 return md5($data . $ wp_server_secret);181 return md5($data . $this->secret); 185 182 } 186 183 } … … 398 395 399 396 function WP_Object_Cache() { 400 global $blog_id ;397 global $blog_id, $wpdb; 401 398 402 399 if (defined('DISABLE_CACHE')) … … 427 424 $this->expiration_time = CACHE_EXPIRATION_TIME; 428 425 426 if ( defined('WP_SECRET') ) 427 $this->secret = WP_SECRET; 428 else 429 $this->secret = DB_PASSWORD . DB_USER . DB_NAME . DB_HOST . ABSPATH; 430 429 431 $this->blog_id = $this->hash($blog_id); 430 432 } -
trunk/wp-includes/pluggable-functions.php
r3810 r3811 509 509 endif; 510 510 511 if ( !function_exists('wp_salt') ) : 512 function wp_salt() { 513 $salt = get_option('secret'); 514 if ( empty($salt) ) 515 $salt = DB_PASSWORD . DB_USER . DB_NAME . DB_HOST . ABSPATH; 516 517 return $salt; 518 } 519 endif; 520 511 521 if ( !function_exists('wp_hash') ) : 512 522 function wp_hash($data) { 513 $secret = get_option('secret'); 514 if ( empty($secret) ) 515 $secret = DB_PASSWORD; 523 $salt = wp_salt(); 516 524 517 525 if ( function_exists('hash_hmac') ) { 518 return hash_hmac('md5', $data, $s ecret);526 return hash_hmac('md5', $data, $salt); 519 527 } else { 520 return md5($data . $s ecret);528 return md5($data . $salt); 521 529 } 522 530 }
Note: See TracChangeset
for help on using the changeset viewer.