Opened 3 weeks ago
Closed 3 weeks ago
#63364 closed defect (bug) (fixed)
Ensure consistent $expire casting to (int) in wp_cache_set_multiple() and wp_cache_add_multiple() functions
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Cache API | Keywords: | has-patch |
Focuses: | coding-standards | Cc: |
Description
While reviewing the wp_cache_*
functions (e.g., wp_cache_add()
, wp_cache_add_multiple()
, wp_cache_replace()
, wp_cache_set()
, wp_cache_set_multiple()
), I noticed inconsistencies regarding how the $expire
parameter is handled:
- In some functions,
$expire
is explicitly cast to an integer(int) $expire
before passing to$wp_object_cache
methods. - In others,
$expire
is passed directly without casting.
The attached patch ensures consistent integer casting for the $expire
argument across all cache-related wrapper functions, improving type safety and alignment with how object caches typically expect expiration times.
References:
wp_cache_add()
wp_cache_add_multiple()
wp_cache_replace()
wp_cache_set()
wp_cache_set_multiple()
Change History (3)
Note: See
TracTickets for help on using
tickets.
In 60206: