[wp-trac] [WordPress Trac] #38430: Inconsistent return type in `get_active_blog_for_user()`
WordPress Trac
noreply at wordpress.org
Fri Oct 21 11:26:37 UTC 2016
#38430: Inconsistent return type in `get_active_blog_for_user()`
--------------------------------+--------------------------------------
Reporter: flixos90 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Networks and Sites | Version:
Severity: normal | Keywords: needs-patch dev-feedback
Focuses: multisite |
--------------------------------+--------------------------------------
While writing unit tests for #38355, I discovered that
`get_active_blog_for_user()` may possibly return a plain object like those
in the array returned by `get_blogs_of_user()`. We should make sure that
only `WP_Site` objects are returned.
On the other hand, this issue is not really critical since, as far as I
could see, the entire clause starting with `! is_object(...` will never be
reached - I might have missed a use-case, but I tried several
"combinations" of what could happen, but never got to the point where it
was executed.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38430>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list