Skip to content

Commit

Permalink
Use rtrim and only is_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrgicak committed Dec 19, 2024
1 parent e27c6fb commit bb24b49
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,8 @@ export const activatePlugin: StepHandler<ActivatePluginStep> = async (
$relative_plugin_path = substr($relative_plugin_path, strlen($plugin_directory));
}
if (
substr($relative_plugin_path, -1) !== '/' &&
is_dir( $plugin_directory . $relative_plugin_path )
) {
$relative_plugin_path = $relative_plugin_path . '/';
if ( is_dir( $plugin_directory . $relative_plugin_path ) ) {
$relative_plugin_path = rtrim( $relative_plugin_path, '/' ) . '/';
}
$active_plugins = get_option( 'active_plugins' );
Expand Down

0 comments on commit bb24b49

Please sign in to comment.