[wp-trac] [WordPress Trac] #17168: redirect loop when accessing wp-admin/network/
WordPress Trac
noreply at wordpress.org
Sat Jan 11 08:32:44 UTC 2014
#17168: redirect loop when accessing wp-admin/network/
-------------------------------------+-----------------------
Reporter: chaos1 | Owner:
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 3.9
Component: Multisite | Version: 3.1.1
Severity: normal | Resolution:
Keywords: has-patch needs-testing |
-------------------------------------+-----------------------
Changes (by jeremyfelt):
* milestone: Awaiting Review => 3.9
Comment:
If I compare relevant tables between $wpdb->blogs and $wpdb-site,
$wpdb->blogs domain is all lower case were $wpdb->site has capitalization.
This appears to be the key issue. If accessing `example.com/wp-
admin/network/`, the domain in `$wpdb->blogs` must be an exact, case
sensitive match of the site (network) domain. This is done first via
`DOMAIN_CURRENT_SITE` and then `$wpdb->site` if that is not defined.
1. Domains are case-insensitive, so when doing any kind of comparison
operation, it may make sense to `strtolower()` in
[https://core.trac.wordpress.org/browser/trunk/src/wp-
admin/network/admin.php?rev=26913#L18 wp-admin/network/admin.php#L18]
2. It seems out of the ordinary that the same domain with mismatched case
would end up in the database. It'd be nice to see how that happened.
At first glance it seems that the cleanest way forward is to fix the
`$current_site->domain` and `$current_blog->domain` comparison. This
resolves the likely cause of the issue without holding us to much more for
the future.
[attachment:17168.2.diff] takes this approach.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/17168#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list