mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
Always pass integer expirations to cache backends.
props SergeyBiryukov, andreasnrb. fixes #25308. git-svn-id: https://develop.svn.wordpress.org/trunk@25451 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -490,6 +490,7 @@ function get_transient( $transient ) {
|
||||
*/
|
||||
function set_transient( $transient, $value, $expiration = 0 ) {
|
||||
$value = apply_filters( 'pre_set_transient_' . $transient, $value );
|
||||
$expiration = (int) $expiration;
|
||||
|
||||
if ( wp_using_ext_object_cache() ) {
|
||||
$result = wp_cache_set( $transient, $value, 'transient', $expiration );
|
||||
@@ -1049,6 +1050,7 @@ function get_site_transient( $transient ) {
|
||||
*/
|
||||
function set_site_transient( $transient, $value, $expiration = 0 ) {
|
||||
$value = apply_filters( 'pre_set_site_transient_' . $transient, $value );
|
||||
$expiration = (int) $expiration;
|
||||
|
||||
if ( wp_using_ext_object_cache() ) {
|
||||
$result = wp_cache_set( $transient, $value, 'site-transient', $expiration );
|
||||
|
||||
Reference in New Issue
Block a user