Skip to content

Commit 2bce3ed

Browse files
authored
Update src/WP_CLI/CommandWithUpgrade.php
1 parent d75d7b0 commit 2bce3ed

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/WP_CLI/CommandWithUpgrade.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ public function install( $args, $assoc_args ) {
288288
if ( $source_dir === $custom_slug ) {
289289
return $source;
290290
}
291-
$new_path = substr_replace( $source, $custom_slug, (int) strrpos( $source, $source_dir ), strlen( $source_dir ) );
291+
$custom_slug = sanitize_file_name( $custom_slug );
292+
$new_path = substr_replace( $source, $custom_slug, (int) strrpos( $source, $source_dir ), strlen( $source_dir ) );
292293

293294
if ( $wp_filesystem->move( $source, $new_path ) ) {
294295
WP_CLI::log( sprintf( "Renamed '%s' to '%s'.", $source_dir, $custom_slug ) );

0 commit comments

Comments
 (0)