Autoloader: more precise matching (#372)
This commit is contained in:
parent
5b9dadd6fd
commit
1020466756
1 changed files with 3 additions and 5 deletions
|
@ -64,12 +64,10 @@ function init() {
|
|||
spl_autoload_register(
|
||||
function ( $full_class ) {
|
||||
$base_dir = __DIR__ . '/includes/';
|
||||
$base = 'activitypub';
|
||||
$base = 'Activitypub\\';
|
||||
|
||||
$class = strtolower( $full_class );
|
||||
|
||||
if ( strncmp( $class, $base, strlen( $base ) ) === 0 ) {
|
||||
$class = str_replace( 'activitypub\\', '', $class );
|
||||
if ( strncmp( $full_class, $base, strlen( $base ) ) === 0 ) {
|
||||
$class = strtolower( str_replace( $base, '', $full_class ) );
|
||||
|
||||
if ( false !== strpos( $class, '\\' ) ) {
|
||||
$parts = explode( '\\', $class );
|
||||
|
|
Loading…
Reference in a new issue