Skip to:
Content

BuddyPress.org

Changeset 10653


Ignore:
Timestamp:
03/11/2016 02:32:34 PM (9 years ago)
Author:
boonebgorges
Message:

When autoloading, check for the existence of a file before including.

This avoids stepping on the toes of plugins that are using BP-ish prefixes for
their class names.

See #6853.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-loader.php

    r10652 r10653  
    609609        $class = strtolower( str_replace( '_', '-', $class ) );
    610610
    611         require dirname( __FILE__ ) . "/bp-{$component}/classes/class-{$class}.php";
     611        $path = dirname( __FILE__ ) . "/bp-{$component}/classes/class-{$class}.php";
     612
     613        // Sanity check.
     614        if ( ! file_exists( $path ) ) {
     615            return;
     616        }
     617
     618        require $path;
    612619    }
    613620
Note: See TracChangeset for help on using the changeset viewer.