Opened 12 years ago
Closed 9 years ago
#23881 closed defect (bug) (duplicate)
get_transient() could delete transient timeout options in an unexpected way
Reported by: | tenpura | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | 2.8 |
Component: | Options, Meta APIs | Keywords: | has-patch |
Focuses: | Cc: |
Description
get_transient() could delete transient timeout options if a given transient name has the "timeout_" prefix.
To reproduce:
set_transient( 'test', 'test', 60*60 ); get_transient( 'timeout_test' ); // will delete the _transient_timeout_test option
Solution:
Check if get_option( $transient_timeout ) is not returning false.
if ( false !== get_option( $transient_timeout ) && get_option( $transient_timeout ) < time() ) {
Attachments (3)
Change History (11)
#1
@
12 years ago
- Summary changed from get_transient() could delete transient timeout options to get_transient() could delete transient timeout options in an unexpected way
#4
@
12 years ago
- Milestone changed from 3.6 to Future Release
- Severity changed from normal to minor
Punting this until it has unit tests.
This ticket was mentioned in IRC in #wordpress-dev by ericmann. View the logs.
11 years ago
Note: See
TracTickets for help on using
tickets.
Related: [10603], [10665]