Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/20/2020 07:31:47 PM (5 years ago)
Author:
johnjamesjacoby
Message:

Sub-Actions: add is_string() checks to bbp_get/post_request()` functions.

This commit prevents possible PHP warnings when action global variables are sent over as an array using the [] URI syntax, which is not supported.

Props dd32.

(In trunk, for 2.7.0.)

Fixes #3373.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/core/sub-actions.php

    r6923 r7080  
    379379    }
    380380
    381     // Bail if no action
    382     if ( empty( $_POST['action'] ) ) {
     381    // Bail if no action, of if not a string (arrays not supported)
     382    if ( empty( $_POST['action'] ) || ! is_string( $_POST['action'] ) ) {
    383383        return;
    384384    }
     
    412412    }
    413413
    414     // Bail if no action
    415     if ( empty( $_GET['action'] ) ) {
     414    // Bail if no action, or if not a string (arrays not supported)
     415    if ( empty( $_GET['action'] ) || ! is_string( $_GET['action'] ) ) {
    416416        return;
    417417    }
Note: See TracChangeset for help on using the changeset viewer.