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-settings/classes/class-bp-settings-component.php

    r13450 r13495  
    7373        if ( is_user_logged_in() ) {
    7474            if ( ! bp_current_action() || bp_is_current_action( 'general' ) ) {
    75                 require $this->path . 'bp-settings/actions/general.php';
     75                require_once $this->path . 'bp-settings/actions/general.php';
    7676
    7777            // Specific to post requests.
    7878            } elseif ( bp_is_post_request() && in_array( bp_current_action(), $actions, true ) ) {
    79                 require $this->path . 'bp-settings/actions/' . bp_current_action() . '.php';
     79                require_once $this->path . 'bp-settings/actions/' . bp_current_action() . '.php';
    8080            }
    8181        }
     
    8383        // Screens - User profile integration.
    8484        if ( bp_is_user() ) {
    85             require $this->path . 'bp-settings/screens/general.php';
     85            require_once $this->path . 'bp-settings/screens/general.php';
    8686
    8787            // Sub-nav items.
    8888            if ( in_array( bp_current_action(), $actions, true ) ) {
    89                 require $this->path . 'bp-settings/screens/' . bp_current_action() . '.php';
     89                require_once $this->path . 'bp-settings/screens/' . bp_current_action() . '.php';
    9090            }
    9191        }
Note: See TracChangeset for help on using the changeset viewer.