Ticket #25308: 25308.patch
File 25308.patch, 2.9 KB (added by , 11 years ago) |
---|
-
src/wp-includes/cache.php
21 21 * @param int $expire When the cache data should be expired 22 22 * @return bool False if cache key and group already exist, true on success 23 23 */ 24 function wp_cache_add( $key, $data, $group = '', $expire = 0) {24 function wp_cache_add( $key, $data, $group = '', $expire = 0 ) { 25 25 global $wp_object_cache; 26 26 27 return $wp_object_cache->add( $key, $data, $group, $expire);27 return $wp_object_cache->add( $key, $data, $group, (int) $expire ); 28 28 } 29 29 30 30 /** … … 154 154 * @param int $expire When to expire the cache contents 155 155 * @return bool False if not exists, true if contents were replaced 156 156 */ 157 function wp_cache_replace( $key, $data, $group = '', $expire = 0) {157 function wp_cache_replace( $key, $data, $group = '', $expire = 0 ) { 158 158 global $wp_object_cache; 159 159 160 return $wp_object_cache->replace( $key, $data, $group, $expire);160 return $wp_object_cache->replace( $key, $data, $group, (int) $expire ); 161 161 } 162 162 163 163 /** … … 173 173 * @param int $expire When to expire the cache contents 174 174 * @return bool False on failure, true on success 175 175 */ 176 function wp_cache_set( $key, $data, $group = '', $expire = 0) {176 function wp_cache_set( $key, $data, $group = '', $expire = 0 ) { 177 177 global $wp_object_cache; 178 178 179 return $wp_object_cache->set( $key, $data, $group, $expire);179 return $wp_object_cache->set( $key, $data, $group, (int) $expire ); 180 180 } 181 181 182 182 /** … … 320 320 * @param int $expire When to expire the cache contents 321 321 * @return bool False if cache key and group already exist, true on success 322 322 */ 323 function add( $key, $data, $group = 'default', $expire = '') {323 function add( $key, $data, $group = 'default', $expire = 0 ) { 324 324 if ( wp_suspend_cache_addition() ) 325 325 return false; 326 326 … … 334 334 if ( $this->_exists( $id, $group ) ) 335 335 return false; 336 336 337 return $this->set( $key, $data, $group, $expire);337 return $this->set( $key, $data, $group, (int) $expire ); 338 338 } 339 339 340 340 /** … … 509 509 * @param int $expire When to expire the cache contents 510 510 * @return bool False if not exists, true if contents were replaced 511 511 */ 512 function replace( $key, $data, $group = 'default', $expire = '') {512 function replace( $key, $data, $group = 'default', $expire = 0 ) { 513 513 if ( empty( $group ) ) 514 514 $group = 'default'; 515 515 … … 520 520 if ( ! $this->_exists( $id, $group ) ) 521 521 return false; 522 522 523 return $this->set( $key, $data, $group, $expire );523 return $this->set( $key, $data, $group, (int) $expire ); 524 524 } 525 525 526 526 /** … … 559 559 * @param int $expire Not Used 560 560 * @return bool Always returns true 561 561 */ 562 function set( $key, $data, $group = 'default', $expire = '') {562 function set( $key, $data, $group = 'default', $expire = 0 ) { 563 563 if ( empty( $group ) ) 564 564 $group = 'default'; 565 565