Opened 13 years ago
Closed 13 years ago
#22803 closed defect (bug) (fixed)
current_user_can_for_blog() fatal errors in single site
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 3.5 | Priority: | highest omg bbq |
| Severity: | blocker | Version: | 3.5 |
| Component: | Multisite | Keywords: | has-patch commit |
| Focuses: | Cc: |
Description
It calls switch_to_blog() unconditionally. It should not.
We must do an audit of all other switch_to_blog() calls.
Note to plugin authors: If your plugin suddenly starts causing a fatal error in a new release of WordPress, for God's sakes, THAT IS NOT NORMAL. Report it as a bug. Don't just fix it on your own.
Attachments (2)
Change History (6)
#2
@
13 years ago
Note that the WP_Theme one is unchanged from 3.4, when that method was introduced, and requires calling get_allowed_on_site() with a blog_id of something other than the current blog, which doesn't occur in core outside of multisite. (wp_get_themes() will only pass a blog ID to it in multisite.) Haven't seen a single report of this error so far. But of course, it is good to fix.
Note: See
TracTickets for help on using
tickets.
Completed an audit.
current_user_can_for_blog()was the only serious one.WP_Theme->get_allowed_on_site(), was the only other one of note. I independently found it and came up with the same fix as in nacin's22803.diff.22803.2.diffincludes nacin's fix and a simple 2xis_multisite()check forcurrent_user_can_for_blog().