Skip to content

Commit

Permalink
ensure namespace is an exact match
Browse files Browse the repository at this point in the history
  • Loading branch information
mecachisenros committed Feb 4, 2020
1 parent 22552e3 commit f55356e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wp-rest/Autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ private function register_autoloader() {
*/
private function autoload( $class_name ) {

if ( false === strpos( $class_name, $this->namespace ) ) return;

$parts = explode( '\\', $class_name );

if ( $this->namespace !== $parts[0] ) return;

// remove namespace and join class path
$class_path = str_replace( '_', '-', implode( DIRECTORY_SEPARATOR, array_slice( $parts, 1 ) ) );

Expand Down

0 comments on commit f55356e

Please sign in to comment.