Opened 10 years ago
Closed 9 years ago
#16836 closed defect (bug) (fixed)
get_blogs_of_user does not initializes each blog item as stdClass
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 3.3 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Multisite | Keywords: | has-patch |
Focuses: | Cc: |
Description
I am developing a multisite plugin and found that get_blogs_of_user is not initializing each of the blog objects as a stdClass inside the blogs array.
Current code in wp-includes/user.php (Lines 656, 657):
$blogs = array(); $blogs[ $blog_id ]->userblog_id = $blog_id; // Cannot start adding elements to an object that is not yet defined.
Fix:
$blogs = array(); $blogs[ $blog_id ] = new stdClass(); $blogs[ $blog_id ]->userblog_id = $blog_id;
Same happens in lines 702, 706.
Attached is a patch file.
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
Fixed in [18560].