diff --git a/src/Scaffold_Command.php b/src/Scaffold_Command.php index 448589e8..b81ec7f0 100644 --- a/src/Scaffold_Command.php +++ b/src/Scaffold_Command.php @@ -986,11 +986,11 @@ static function ( $item ) use ( $slug ) { private function check_target_directory( $type, $target_dir ) { $parent_dir = dirname( self::canonicalize_path( str_replace( '\\', '/', $target_dir ) ) ); - if ( 'theme' === $type && str_replace( '\\', '/', WP_CONTENT_DIR . '/themes' ) !== $parent_dir ) { + if ( 'theme' === $type && self::canonicalize_path( str_replace( '\\', '/', WP_CONTENT_DIR . '/themes' ) ) !== $parent_dir ) { return sprintf( 'The target directory \'%1$s\' is not in \'%2$s\'.', $target_dir, WP_CONTENT_DIR . '/themes' ); } - if ( 'plugin' === $type && str_replace( '\\', '/', WP_PLUGIN_DIR ) !== $parent_dir ) { + if ( 'plugin' === $type && self::canonicalize_path( str_replace( '\\', '/', WP_PLUGIN_DIR ) ) !== $parent_dir ) { return sprintf( 'The target directory \'%1$s\' is not in \'%2$s\'.', $target_dir, WP_PLUGIN_DIR ); }