Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/11/2015 05:03:48 PM (9 years ago)
Author:
r-a-y
Message:

Core: Fix issue with bp_verify_nonce_request() when a port is used in the home URL.

When a site is using a port for their home URL, bp_verify_nonce_request()
can sometimes fail. This is because the port is duplicated twice due to
$_SERVER['HTTP_HOST'] including the port number and we're appending the
port number again with $_SERVER['SERVER_PORT'].

This commit appends $_SERVER['SERVER_PORT'] if $_SERVER['HTTP_HOST']
does not already include the port number and includes a unit test.

Fixes #6528.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-functions.php

    r10039 r10044  
    20562056
    20572057    // Maybe include the port, if it's included in home_url()
    2058     if ( isset( $parsed_home['port'] ) ) {
     2058    if ( isset( $parsed_home['port'] ) && false === strpos( $_SERVER['HTTP_HOST'], ':' ) ) {
    20592059        $request_host = $_SERVER['HTTP_HOST'] . ':' . $_SERVER['SERVER_PORT'];
    20602060    } else {
Note: See TracChangeset for help on using the changeset viewer.