Skip to:
Content

BuddyPress.org

Changeset 7515


Ignore:
Timestamp:
11/05/2013 02:34:47 PM (12 years ago)
Author:
boonebgorges
Message:

Cast a broader net when checking for wp-login.php for spammed users

By checking only $_GLOBALSpagenow?, we're relying on WordPress to have
initialized properly. In some instances, this does not happen reliably, so
we add a fallback to the value of $_SERVERSCRIPT_NAME?. This helps to
prevent redirect loops for spammers in a larger number of instances.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-members/bp-members-functions.php

    r7514 r7515  
    15421542function bp_stop_live_spammer() {
    15431543    // if we're on the login page, stop now to prevent redirect loop
    1544     if ( isset( $_GLOBALS['pagenow'] ) && strpos( $GLOBALS['pagenow'], 'wp-login.php' ) !== false ) {
     1544    $is_login = false;
     1545    if ( isset( $_GLOBALS['pagenow'] ) && false !== strpos( $GLOBALS['pagenow'], 'wp-login.php' ) ) {
     1546        $is_login = true;
     1547    } else if ( isset( $_SERVER['SCRIPT_NAME'] ) && false !== strpos( $_SERVER['SCRIPT_NAME'], 'wp-login.php' ) ) {
     1548        $is_login = true;
     1549    }
     1550
     1551    if ( $is_login ) {
    15451552        return;
    15461553    }
Note: See TracChangeset for help on using the changeset viewer.