Skip to:
Content

bbPress.org

Changeset 6875


Ignore:
Timestamp:
12/03/2018 08:42:31 PM (3 years ago)
Author:
johnjamesjacoby
Message:

Forums: protect against a missing/malformed forum_id value when listing subforums.

Fixes #3232.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/forums/template.php

    r6872 r6875  
    651651
    652652    // Use passed integer as post_parent
    653     if ( is_numeric( $args ) ) {
     653    if ( is_numeric( $args ) && ! empty( $args ) ) {
    654654        $args = array( 'post_parent' => bbp_get_forum_id( $args ) );
    655655    }
     
    730730    $output = '';
    731731
     732    // Query for subforums
     733    $sub_forums = ! empty( $r['forum_id'] )
     734        ? bbp_forum_get_subforums( $r['forum_id'] )
     735        : array();
     736
    732737    // Loop through forums and create a list
    733     $sub_forums = bbp_forum_get_subforums( $r['forum_id'] );
    734738    if ( ! empty( $sub_forums ) ) {
    735739        foreach ( $sub_forums as $sub_forum ) {
Note: See TracChangeset for help on using the changeset viewer.