Changeset 3813 for branches/2.0/wp-includes/cache.php
- Timestamp:
- 05/31/2006 05:01:09 AM (20 years ago)
- File:
-
- 1 edited
-
branches/2.0/wp-includes/cache.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.