Skip to:
Content

BuddyPress.org

Ticket #8775: 8775.patch

File 8775.patch, 968 bytes (added by needle, 2 years ago)

Fixes #8775

  • src/bp-members/bp-members-functions.php

     
    25592559
    25602560        $is_site_creation = false;
    25612561
    2562         $referer = wp_get_referer();
    2563 
    25642562        // A new site is being added.
    25652563        if ( isset( $_POST['stage'] ) && $_POST['stage'] === 'gimmeanotherblog' ) {
    25662564                $is_site_creation = true;
    25672565
    2568         // We've arrived at wp-signup.php from my-sites.php.
    2569         } elseif ( $referer ) {
    2570                 $referer_path     = wp_parse_url( $referer, PHP_URL_PATH );
    2571                 $is_site_creation = false !== strpos( $referer_path, 'wp-admin/my-sites.php' );
     2566        } else {
     2567                // The WordPress registration setting must allow access.
     2568                $registration = get_site_option( 'registration' );
     2569                if ( is_user_logged_in() && in_array( $registration, [ 'blog', 'all' ] ) ) {
     2570                        $is_site_creation = true;
     2571                }
    25722572        }
    25732573
    25742574        if ( $is_site_creation ) {