Skip to content

Commit d1ccde9

Browse files
swissspidyCopilot
andauthored
Update src/Plugin_Command.php
Co-authored-by: Copilot <[email protected]>
1 parent 920cefb commit d1ccde9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Plugin_Command.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,9 +1405,11 @@ public function is_active( $args, $assoc_args ) {
14051405

14061406
// Check if the input matches the plugin file in various ways
14071407
// This mirrors the logic in WP_CLI\Fetchers\Plugin::get()
1408-
if ( "$input_name.php" === $plugin_file ||
1409-
$plugin_file === $input_name ||
1410-
( dirname( $plugin_file ) === $input_name && '.' !== $input_name ) ) {
1408+
if (
1409+
( ! empty( $input_name ) && "$input_name.php" === $plugin_file ) ||
1410+
( ! empty( $input_name ) && $plugin_file === $input_name ) ||
1411+
( ! empty( $input_name ) && dirname( $plugin_file ) === $input_name && '.' !== $input_name )
1412+
) {
14111413
$found_in_active = $plugin_file;
14121414
break;
14131415
}

0 commit comments

Comments
 (0)