Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/12/2017 02:26:15 AM (9 years ago)
Author:
boonebgorges
Message:

Members: Require a form submission to activate an account.

Previously, simply loading a URL of the form /activate/12345 would activate
the account with key 12345. This caused conflicts with some mail scanning
services, which follow links in emails, causing accounts to be self-activated.

A small backward-compatibility layer ensures that custom activate.php
templates containing forms with action="get" continue to work.

Fixes #6049.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-template.php

    r11588 r11766  
    21192119
    21202120/**
     2121 * Get the activation key from the current request URL.
     2122 *
     2123 * @since 3.0.0
     2124 *
     2125 * @return string
     2126 */
     2127function bp_get_current_activation_key() {
     2128        $key = '';
     2129
     2130        if ( bp_is_current_component( 'activate' ) ) {
     2131                if ( isset( $_GET['key'] ) ) {
     2132                        $key = wp_unslash( $_GET['key'] );
     2133                } else {
     2134                        $key = bp_current_action();
     2135                }
     2136        }
     2137
     2138        /**
     2139         * Filters the activation key from the current request URL.
     2140         *
     2141         * @since 3.0.0
     2142         *
     2143         * @param string $key Activation key.
     2144         */
     2145        return apply_filters( 'bp_get_current_activation_key', $key );
     2146}
     2147
     2148/**
    21212149 * Output the username submitted during signup.
    21222150 *
Note: See TracChangeset for help on using the changeset viewer.