Skip to:
Content

bbPress.org

Changeset 6135


Ignore:
Timestamp:
12/08/2016 02:43:27 PM (5 years ago)
Author:
johnjamesjacoby
Message:

Tools: Fix undeclared variables and incorrect variable types, for improved PHP 7.1 compatibility.

This will quiet down most of our continuous integration noise.

Props hellofromTonya. Fixes #3031.

Location:
trunk/src/includes
Files:
4 edited

Legend:

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

    r6115 r6135  
    513513        if ( current_user_can( 'read_private_topics' ) || current_user_can( 'edit_others_topics' ) || current_user_can( 'view_trash' ) ) {
    514514
     515            // Declare empty arrays
     516            $topics = $topic_titles = array();
     517
    515518            // Pending
    516519            $topics['pending'] = ( ! empty( $r['count_pending_topics'] ) && current_user_can( 'edit_others_topics' ) ) ? (int) $all_topics->{$pending} : 0;
     
    549552        if ( current_user_can( 'read_private_replies' ) || current_user_can( 'edit_others_replies' ) || current_user_can( 'view_trash' ) ) {
    550553
     554            // Declare empty arrays
     555            $replies = $reply_titles = array();
     556
    551557            // Pending
    552558            $replies['pending'] = ( ! empty( $r['count_pending_replies'] ) && current_user_can( 'edit_others_replies' ) ) ? (int) $all_replies->{$pending} : 0;
     
    572578            // Compile the hidden replies title
    573579            $hidden_reply_title = implode( ' | ', array_filter( $reply_titles ) );
    574 
    575580        }
    576581    }
  • trunk/src/includes/forums/functions.php

    r6113 r6135  
    21952195        // Default to public status
    21962196        if ( empty( $post_stati ) ) {
    2197             $post_stati[] = bbp_get_public_status_id();
     2197            $post_stati = array( bbp_get_public_status_id() );
    21982198
    21992199        // Split the status string
  • trunk/src/includes/forums/template.php

    r6056 r6135  
    694694
    695695    // Setup post status array
    696     $post_stati[] = bbp_get_public_status_id();
     696    $post_stati = array( bbp_get_public_status_id() );
    697697
    698698    // Super admin get whitelisted post statuses
  • trunk/src/includes/users/template.php

    r6118 r6135  
    17221722            $anonymous = bbp_is_reply_anonymous( $r['post_id'] );
    17231723
     1724            // Declare empty array
     1725            $author_links = array();
     1726
    17241727            // Get avatar
    17251728            if ( 'avatar' === $r['type'] || 'both' === $r['type'] ) {
Note: See TracChangeset for help on using the changeset viewer.