Skip to content

Commit d0e8a93

Browse files
authored
Apply suggestion from @swissspidy
1 parent 4ecf862 commit d0e8a93

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/WP_CLI/CommandWithUpgrade.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public function install( $args, $assoc_args ) {
218218
// Pattern matches: https://wordpress.org/plugins/plugin-slug/ or https://wordpress.org/themes/theme-slug/
219219
// Capture group 1: type (plugins|themes)
220220
// Capture group 2: slug (the plugin or theme slug name)
221-
if ( preg_match( '~^https?://wordpress\.org/(plugins|themes)/([^/]+)/?~', $slug, $matches ) ) {
221+
if ( preg_match( '~^https?://wordpress\.org/(plugins|themes)/([^/]+)/?$~', $slug, $matches ) ) {
222222
$slug = $matches[2]; // Extract the slug.
223223
$is_remote = false;
224224
WP_CLI::log( sprintf( 'Detected WordPress.org %s directory URL, using slug: %s', $matches[1], $slug ) );

0 commit comments

Comments
 (0)