Changeset 3813
- Timestamp:
- 05/31/2006 05:01:09 AM (20 years ago)
- Location:
- branches/2.0
- Files:
-
- 4 edited
-
wp-admin/upgrade-schema.php (modified) (1 diff)
-
wp-includes/cache.php (modified) (5 diffs)
-
wp-includes/pluggable-functions.php (modified) (2 diffs)
-
wp-includes/version.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/wp-admin/upgrade-schema.php
r3453 r3813 230 230 add_option('upload_path', 'wp-content/uploads'); 231 231 } 232 233 // 2.0.3 234 add_option('secret', md5(uniqid(microtime()))); 232 235 233 236 // Delete unused options -
branches/2.0/wp-includes/cache.php
r3797 r3813 65 65 var $warm_cache_hits = 0; 66 66 var $cache_misses = 0; 67 var $secret = ''; 67 68 68 69 function acquire_lock() { … … 143 144 } 144 145 145 $cache_file = $this->cache_dir.$this->get_group_dir($group)."/". md5($id.DB_PASSWORD).'.php';146 $cache_file = $this->cache_dir.$this->get_group_dir($group)."/".$this->hash($id).'.php'; 146 147 if (!file_exists($cache_file)) { 147 148 $this->non_existant_objects[$group][$id] = true; … … 172 173 173 174 return "{$this->blog_id}/$group"; 175 } 176 177 function hash($data) { 178 if ( function_exists('hash_hmac') ) { 179 return hash_hmac('md5', $data, $this->secret); 180 } else { 181 return md5($data . $this->secret); 182 } 174 183 } 175 184 … … 333 342 $ids = array_unique($ids); 334 343 foreach ($ids as $id) { 335 $cache_file = $group_dir. md5($id.DB_PASSWORD).'.php';344 $cache_file = $group_dir.$this->hash($id).'.php'; 336 345 337 346 // Remove the cache file if the key is not set. … … 425 434 $this->expiration_time = CACHE_EXPIRATION_TIME; 426 435 427 $this->blog_id = md5($blog_id); 436 if ( defined('WP_SECRET') ) 437 $this->secret = WP_SECRET; 438 else 439 $this->secret = DB_PASSWORD . DB_USER . DB_NAME . DB_HOST . ABSPATH; 440 441 $this->blog_id = $this->hash($blog_id); 428 442 } 429 443 } -
branches/2.0/wp-includes/pluggable-functions.php
r3780 r3813 489 489 490 490 //Allow for expanding range, but only do one check if we can 491 if( substr( md5($i . DB_PASSWORD . $action . $uid), -12, 10) == $nonce || substr(md5(($i - 1) . DB_PASSWORD. $action . $uid), -12, 10) == $nonce )491 if( substr(wp_hash($i . $action . $uid), -12, 10) == $nonce || substr(wp_hash(($i - 1) . $action . $uid), -12, 10) == $nonce ) 492 492 return true; 493 493 return false; … … 502 502 $i = ceil(time() / 43200); 503 503 504 return substr(md5($i . DB_PASSWORD . $action . $uid), -12, 10); 504 return substr(wp_hash($i . $action . $uid), -12, 10); 505 } 506 endif; 507 508 if ( !function_exists('wp_salt') ) : 509 function wp_salt() { 510 $salt = get_option('secret'); 511 if ( empty($salt) ) 512 $salt = DB_PASSWORD . DB_USER . DB_NAME . DB_HOST . ABSPATH; 513 514 return $salt; 515 } 516 endif; 517 518 if ( !function_exists('wp_hash') ) : 519 function wp_hash($data) { 520 $salt = wp_salt(); 521 522 if ( function_exists('hash_hmac') ) { 523 return hash_hmac('md5', $data, $salt); 524 } else { 525 return md5($data . $salt); 526 } 505 527 } 506 528 endif; -
branches/2.0/wp-includes/version.php
r3797 r3813 4 4 5 5 $wp_version = '2.0.3-beta'; 6 $wp_db_version = 3 796;6 $wp_db_version = 3310; 7 7 8 8 ?>
Note: See TracChangeset
for help on using the changeset viewer.