Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/02/2023 02:05:08 AM (3 years ago)
Author:
imath
Message:

Prevent potential issues with late_includes() in Component classes

Use require_once instead of require to load action & screen files.

See #4954
Fixes #8910
Closes https://github.com/buddypress/buddypress/pull/112

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/classes/class-bp-activity-component.php

    r13492 r13495  
    122122                                in_array( bp_current_action(), array( 'delete', 'spam', 'post', 'reply', 'favorite', 'unfavorite' ), true )
    123123                        ) {
    124                                 require $this->path . 'bp-activity/actions/' . bp_current_action() . '.php';
     124                                require_once $this->path . 'bp-activity/actions/' . bp_current_action() . '.php';
    125125                        }
    126126
    127127                        // RSS feeds.
    128128                        if ( bp_is_current_action( 'feed' ) || bp_is_action_variable( 'feed', 0 ) ) {
    129                                 require $this->path . 'bp-activity/actions/feeds.php';
     129                                require_once $this->path . 'bp-activity/actions/feeds.php';
    130130                        }
    131131
    132132                        // Screens - Directory.
    133133                        if ( bp_is_activity_directory() ) {
    134                                 require $this->path . 'bp-activity/screens/directory.php';
     134                                require_once $this->path . 'bp-activity/screens/directory.php';
    135135                        }
    136136
    137137                        // Screens - User main nav.
    138138                        if ( bp_is_user() ) {
    139                                 require $this->path . 'bp-activity/screens/just-me.php';
     139                                require_once $this->path . 'bp-activity/screens/just-me.php';
    140140                        }
    141141
     
    163163
    164164                        if ( bp_is_user() && isset( $filenames[ $slug ] ) ) {
    165                                 require $this->path . 'bp-activity/screens/' . $filenames[ $slug ] . '.php';
     165                                require_once $this->path . 'bp-activity/screens/' . $filenames[ $slug ] . '.php';
    166166                        }
    167167
    168168                        // Screens - Single permalink.
    169169                        if ( bp_is_current_action( 'p' ) || is_numeric( bp_current_action() ) ) {
    170                                 require $this->path . 'bp-activity/screens/permalink.php';
     170                                require_once $this->path . 'bp-activity/screens/permalink.php';
    171171                        }
    172172
Note: See TracChangeset for help on using the changeset viewer.