#25328 closed defect (bug) (fixed)
switch_to_blog() doesn't fail on validation
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.9 | Priority: | low |
Severity: | minor | Version: | 3.0 |
Component: | Networks and Sites | Keywords: | has-patch commit |
Focuses: | docs, multisite | Cc: |
Description
Currently you can pass in a non existing blog id. It will always return true since there is no validation in switch_to_blog(). Even if the PHPDocs says it does do that.
The best place to add a check is wpdb::set_blog_id() but I'm not sure if we want to add an extra database on the init of a site.
Attachments (1)
Change History (12)
#1
in reply to:
↑ description
@
10 years ago
#5
@
10 years ago
- Keywords has-patch added; dev-feedback needs-docs removed
- Milestone changed from Awaiting Review to 3.9
- Priority changed from normal to low
- Severity changed from normal to minor
25328.diff modifies docs to show that switch_to_blog()
always returns true.
#9
@
10 years ago
- Owner set to DrewAPicture
- Resolution set to fixed
- Status changed from new to closed
In 27347:
#10
follow-up:
↓ 11
@
10 years ago
Devil's advocate for [27347]: The docs weren't actually wrong — there was just no validation for which we would return false. We may want to add a falsely return value later. What do we think about making it say "always returns true. Could return false on failure in the future."
#11
in reply to:
↑ 10
@
10 years ago
Replying to nacin:
Devil's advocate for [27347]: The docs weren't actually wrong — there was just no validation for which we would return false. We may want to add a falsely return value later. What do we think about making it say "always returns true. Could return false on failure in the future."
I'm not a big fan of conjecture when it comes to documentation — it either does or it doesn't. That said, I could get behind a @todo
specifying a need for future clarification.
Replying to markoheijnen:
We don't. This seems like a wontfix.