[buddypress-trac] [BuddyPress Trac] #8038: wp-signup.php seems doesn't managed properly in multisite
buddypress-trac
noreply at wordpress.org
Fri Mar 1 03:38:34 UTC 2019
#8038: wp-signup.php seems doesn't managed properly in multisite
--------------------------------+------------------------------
Reporter: oxibug | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Registration | Version: 4.1.0
Severity: normal | Resolution:
Keywords: dev-feedback close |
--------------------------------+------------------------------
Changes (by boonebgorges):
* keywords: dev-feedback => dev-feedback close
* priority: omg pizza => normal
* severity: critical => normal
Comment:
Thanks very much for the detailed report.
Technically speaking, it's only possible for BuddyPress to hijack
example.com/wp-signup.php if BP is active on example.com. If BP is active
only on example.com/forum, then it can't do anything about wp-signup.php.
So there's nothing that can be done about your case 2. Moreover, I don't
think we'd *want* to change that behavior, as there are probably good use
cases for forcing BP signup on a subsite but allowing more general
registration on other sites in the network.
As for network-activation: It appears that wp-signup.php redirection has
been broken in BuddyPress for a long time. Years ago, if memory serves, we
used to redirect aggressively away from wp-signup.php, but things have
changed: see #6178, and before that, [6449]. At this point, redirection
only takes place if you visit `wp-signup.php?action=register`.
The reasons behind this look pretty complicated. I don't understand
[10665]. The function signature for `strpos()` is `( $haystack, $needle
)`, so it seems like [10665] gets it wrong.
cc @imath, who can perhaps clear up my understanding. That said, going
back to aggressive redirection at this point feels like it could break
stuff. I'd suggest that, if you want redirection on your site, you can
implement it yourself. The following should do it:
{{{
function bp8038_wpsignup_redirect() {
// Bail in admin or if custom signup page is broken.
if ( is_admin() || ! bp_has_custom_signup_page() ) {
return;
}
// Not at the WP core signup page and action is not register.
if ( ! empty( $_SERVER['SCRIPT_NAME'] ) && false === strpos(
$_SERVER['SCRIPT_NAME'], 'wp-signup.php' ) ) {
return;
}
bp_core_redirect( bp_get_signup_page() );
}
add_action( 'bp_init', 'bp8038_wpsignup_redirect', 0 );
}}}
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8038#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list