Changeset 25451
- Timestamp:
- 09/16/2013 05:42:49 PM (11 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/cache.php
r23328 r25451 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) {25 global $wp_object_cache; 26 27 return $wp_object_cache->add( $key, $data, $group, $expire);24 function wp_cache_add( $key, $data, $group = '', $expire = 0 ) { 25 global $wp_object_cache; 26 27 return $wp_object_cache->add( $key, $data, $group, (int) $expire ); 28 28 } 29 29 … … 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) {158 global $wp_object_cache; 159 160 return $wp_object_cache->replace( $key, $data, $group, $expire);157 function wp_cache_replace( $key, $data, $group = '', $expire = 0 ) { 158 global $wp_object_cache; 159 160 return $wp_object_cache->replace( $key, $data, $group, (int) $expire ); 161 161 } 162 162 … … 174 174 * @return bool False on failure, true on success 175 175 */ 176 function wp_cache_set( $key, $data, $group = '', $expire = 0) {177 global $wp_object_cache; 178 179 return $wp_object_cache->set( $key, $data, $group, $expire);176 function wp_cache_set( $key, $data, $group = '', $expire = 0 ) { 177 global $wp_object_cache; 178 179 return $wp_object_cache->set( $key, $data, $group, (int) $expire ); 180 180 } 181 181 … … 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; … … 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 … … 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'; … … 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 … … 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'; -
trunk/src/wp-includes/option.php
r25350 r25451 491 491 function set_transient( $transient, $value, $expiration = 0 ) { 492 492 $value = apply_filters( 'pre_set_transient_' . $transient, $value ); 493 $expiration = (int) $expiration; 493 494 494 495 if ( wp_using_ext_object_cache() ) { … … 1050 1051 function set_site_transient( $transient, $value, $expiration = 0 ) { 1051 1052 $value = apply_filters( 'pre_set_site_transient_' . $transient, $value ); 1053 $expiration = (int) $expiration; 1052 1054 1053 1055 if ( wp_using_ext_object_cache() ) {
Note: See TracChangeset
for help on using the changeset viewer.