[wp-trac] [WordPress Trac] #26855: get_blogaddress_by_id used in wp-activate.php limits functionality in MU Domain Mapped Sites
WordPress Trac
noreply at wordpress.org
Fri Nov 18 16:59:59 UTC 2016
#26855: get_blogaddress_by_id used in wp-activate.php limits functionality in MU
Domain Mapped Sites
-------------------------------------+-------------------------
Reporter: boboudreau | Owner: jeremyfelt
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 4.7
Component: Networks and Sites | Version: 3.0
Severity: normal | Resolution:
Keywords: has-patch needs-testing | Focuses: multisite
-------------------------------------+-------------------------
Changes (by warrenreeves):
* status: closed => reopened
* type: enhancement => defect (bug)
* resolution: fixed =>
Comment:
We have been encountering the original issue in this ticket, we have
attempted to change core files to fix it using the resolution which is
upcoming in 4.7, however this has not fixed the issue in a multisite site
with mapped domains.
We found this from the URL being incorrect for directing to the login or
homepage.
Upon further investigation it appears that the line 128 contains an
incorrect variable reference.
{{{#!php
$url = isset( $result['blog_id'] ) ? get_blogaddress_by_id( (int)
$result['blog_id'] ) : '';
}}}
The $result variable does not contain 'blog_id', and after dumping the
variable outputs the correct blog id required in the below variable.
{{{#!php
$result['meta']['add_to_blog']
}}}
Upon changing all references to $result[ 'blog_id' ] in this file to
$result[ 'meta' ][ 'add_to_blog' ].
It also appears on line 139.
{{{#!php
switch_to_blog( (int) $result['blog_id'] );
}}}
In fact it looks as though the if on line 128 may actually not be
required, due to the fact that currently it is checking for a variable
which does not exist (blog_id) therefore is always failing to ''.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26855#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list