[wp-trac] [WordPress Trac] #14047: get_user_by() makes use of the cache even if it does not exists any longer

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 22 17:06:20 UTC 2010


#14047: get_user_by() makes use of the cache even if it does not exists any longer
--------------------------+-------------------------------------------------
 Reporter:  hakre         |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  General       |     Version:  2.9.2     
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 This is mostly an error report, and it's quite bloody. But I thought I
 better report it before it gets lost.

 I ran over this while having the following error message:

 >  Fatal error: Call to a member function get() on a non-object in wp-
 includes\cache.php on line 93

 That is the following code:

 {{{
 function wp_cache_get($id, $flag = '') {
         global $wp_object_cache;

         return $wp_object_cache->get($id, $flag);
 }
 }}}

 So this API function (!) is blindly using that global variable w/o even
 checking if it's that what it thinks it is. Well not only that this is
 dangerous with any global in this case, every other function that relies
 on the function like {{{get_user_by()}}} does exit with a fatal error. for
 example after the cache has been shut down.

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


More information about the wp-trac mailing list