Skip to content

Commit 31ebccb

Browse files
Fix fatal error in invalid plugin update offer (#354)
* Ignore plugin update offer if version is invalid * Fix PHPCS issues
1 parent bb93280 commit 31ebccb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/WP_CLI/CommandWithUpgrade.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,11 @@ private function get_minor_or_patch_updates( $items, $type, $insecure, $require_
631631
$update_version = false;
632632
$update_package = false;
633633
foreach ( $data['versions'] as $version => $download_link ) {
634-
$update_type = Utils\get_named_sem_ver( $version, $item['version'] );
634+
try {
635+
$update_type = Utils\get_named_sem_ver( $version, $item['version'] );
636+
} catch ( \Exception $e ) {
637+
continue;
638+
}
635639
// Compared version must be older.
636640
if ( ! $update_type ) {
637641
continue;

0 commit comments

Comments
 (0)