Skip to:
Content

bbPress.org

Ticket #3373: 3373.diff

File 3373.diff, 996 bytes (added by dd32, 6 years ago)
  • includes/core/sub-actions.php

    function bbp_post_request() {  
    400400}
    401401
    402402/**
    403403 * The main action used for handling theme-side GET requests
    404404 *
    405405 * @since 2.3.0 bbPress (r4550)
    406406 */
    407407function bbp_get_request() {
    408408
    409409        // Bail if not a POST action
    410410        if ( ! bbp_is_get_request() ) {
    411411                return;
    412412        }
    413413
    414414        // Bail if no action
    415         if ( empty( $_GET['action'] ) ) {
     415        if ( empty( $_GET['action'] ) || ! is_string( $_GET['action'] ) ) {
    416416                return;
    417417        }
    418418
    419419        // Sanitize the GET action
    420420        $action = sanitize_key( $_GET['action'] );
    421421
    422422        // Bail if action was totally invalid
    423423        if ( empty( $action ) ) {
    424424                return;
    425425        }
    426426
    427427        // This dynamic action is probably the one you want to use. It narrows down
    428428        // the scope of the 'action' without needing to check it in your function.
    429429        do_action( 'bbp_get_request_' . $action );
    430430