Skip to:
Content

bbPress.org

Changeset 5907


Ignore:
Timestamp:
08/11/2015 08:08:36 PM (6 years ago)
Author:
johnjamesjacoby
Message:

Common: bring bbp_verify_nonce_request() up to speed with improvments in BuddyPress.

See #buddypress6528. Props r-a-y.

Location:
trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/common/functions.php

    r5853 r5907  
    17851785
    17861786    // Maybe include the port, if it's included in home_url()
    1787     if ( isset( $parsed_home['port'] ) ) {
     1787    if ( isset( $parsed_home['port'] ) && false === strpos( $_SERVER['HTTP_HOST'], ':' ) ) {
    17881788        $request_host = $_SERVER['HTTP_HOST'] . ':' . $_SERVER['SERVER_PORT'];
    17891789    } else {
     
    17971797    /** Look for match ********************************************************/
    17981798
    1799     // Filter the requested URL, for configurations like reverse proxying
     1799    /**
     1800     * Filters the requested URL being nonce-verified.
     1801     *
     1802     * Useful for configurations like reverse proxying.
     1803     *
     1804     * @since bbPress (2.5.0)
     1805     *
     1806     * @param string $requested_url The requested URL.
     1807     */
    18001808    $matched_url = apply_filters( 'bbp_verify_nonce_request_url', $requested_url );
    18011809
    18021810    // Check the nonce
    1803     $result = isset( $_REQUEST[$query_arg] ) ? wp_verify_nonce( $_REQUEST[$query_arg], $action ) : false;
     1811    $result = isset( $_REQUEST[ $query_arg ] ) ? wp_verify_nonce( $_REQUEST[ $query_arg ], $action ) : false;
    18041812
    18051813    // Nonce check failed
     
    18081816    }
    18091817
    1810     // Do extra things
     1818    /**
     1819     * Fires at the end of the nonce verification check.
     1820     *
     1821     * @since bbPress (2.2.0)
     1822     *
     1823     * @param string $action Action nonce.
     1824     * @param bool   $result Boolean result of nonce verification.
     1825     */
    18111826    do_action( 'bbp_verify_nonce_request', $action, $result );
    18121827
Note: See TracChangeset for help on using the changeset viewer.