Opened 15 years ago
Closed 15 years ago
#12820 closed defect (bug) (fixed)
get_blog_prefix() does not return prefix for current blog when no blog ID is passed
Reported by: | ryan | Owned by: | |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Multisite | Keywords: | |
Focuses: | Cc: |
Description
get_blog_prefix() is called without a blog_id arg in several places, notably in wp-admin/includes/user.php when creating level_keys. Since get_blog_prefix() does not return the current prefix when blog ID is not passed and is_multisite(), the keys are wrong. I suspect these places should use $wpdb->prefix.
There's also a call to get_blog_prefix() with no args in ms-settings.php. This results in $table_prefix being assigned base_prefix. I think is expected but should be verified.
Attachments (1)
Change History (9)
#4
@
15 years ago
I wanted to leave this one open for a few days just in case there was an issue that cropped up as a result of the change.
#5
follow-up:
↓ 6
@
15 years ago
Cool, I haven't seen any problems anywhere yet. Using null would have made more sense than -1, though.
#6
in reply to:
↑ 5
@
15 years ago
Replying to nacin:
Cool, I haven't seen any problems anywhere yet. Using null would have made more sense than -1, though.
That was changed from a to a 0 on the grounds of datatype consistency (way back when). So I used the -1 to maintain that. The null makes more sense to me as well but technically is not a number.
MU returned prefix if no blog ID was given. 3.0 currently returns base_prefix. We should return prefix to be compat with MU.