[wp-trac] [WordPress Trac] #23881: get_transient() could delete transient timeout options

WordPress Trac noreply at wordpress.org
Thu Mar 28 11:02:08 UTC 2013


#23881: get_transient() could delete transient timeout options
-----------------------------+--------------------------
 Reporter:  tenpura          |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  General
  Version:  trunk            |   Severity:  normal
 Keywords:  has-patch        |
-----------------------------+--------------------------
 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() ) {
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23881>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list