Changes between Version 1 and Version 2 of Ticket #15458, comment 42
- Timestamp:
- 08/07/2011 02:09:09 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #15458, comment 42
v1 v2 1 1 {{{ 2 $this->caps = &$this->data->{$this->cap_key}; 2 $this->caps = $this->data->{$this->cap_key}; 3 if ( ! is_array( $this->caps ) ) 4 $this->caps = array(); 3 5 }}} 4 6 5 Th at line in WP_User::_init_caps() issomehow causing cache pollution. wp_cache_get($id, 'users'), as done in get_userdata(), will sometimes return an object with the wp_xxx_capabilities property set ( where xxx is the current blog id). The value is an empty array. This confuses get_blogs_of_user(), which sees that the property is set and mistakenly thinks the user belongs to the current blog. Since the cache clones objects on set and get this is rather unexpected.7 Those lines in WP_User::_init_caps() are somehow causing cache pollution. wp_cache_get($id, 'users'), as done in get_userdata(), will sometimes return an object with the wp_xxx_capabilities property set ( where xxx is the current blog id). The value is an empty array. This confuses get_blogs_of_user(), which sees that the property is set and mistakenly thinks the user belongs to the current blog. Since the cache clones objects on set and get this is rather unexpected.