[wp-trac] [WordPress Trac] #30380: get_transient doesn't check the return of get_option

WordPress Trac noreply at wordpress.org
Tue Nov 18 06:48:50 UTC 2014


#30380: get_transient doesn't check the return of get_option
--------------------------------+-----------------------------
 Reporter:  jamesgol            |      Owner:
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Options, Meta APIs  |    Version:  trunk
 Severity:  normal              |   Keywords:
  Focuses:                      |
--------------------------------+-----------------------------
 When calling get_transient on a key that doesn't exist, notoptions[$key]
 is set so it won't do any further queries, but it doesn't go far enough.
 Since the get_option( $transient_timeout ) doesn't check the return well
 enough it will always cause 2 more queries.  (SELECT autoload FROM
 wp_options ...)

 If get_options( $transient_timeout ) is returning false, what is the point
 of trying to delete it.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30380>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list