diff --git a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/UpdateCheck.php b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/UpdateCheck.php index 669d0e5b594..196cacd626c 100644 --- a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/UpdateCheck.php +++ b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/UpdateCheck.php @@ -130,7 +130,8 @@ private function createVersionFromGithubResponse(string $shopwareVersion, array private function getRelease(string $shopwareVersion, array $releaseInformation): array { foreach ($releaseInformation as $release) { - if (version_compare($shopwareVersion, ltrim($release['tag_name'], 'v'), '>=')) { + $release['tag_name'] = ltrim($release['tag_name'], 'v'); + if (version_compare($shopwareVersion, $release['tag_name'], '>=')) { continue; } diff --git a/tests/Unit/Plugin/Backend/SwagUpdate/Components/UpdateCheckTest.php b/tests/Unit/Plugin/Backend/SwagUpdate/Components/UpdateCheckTest.php index 113fc734db4..2d87bc63798 100644 --- a/tests/Unit/Plugin/Backend/SwagUpdate/Components/UpdateCheckTest.php +++ b/tests/Unit/Plugin/Backend/SwagUpdate/Components/UpdateCheckTest.php @@ -134,7 +134,7 @@ public function testCheckUpdateReturnsVersionWithNewRelease(): void $version = $updateChecker->checkUpdate('5.7.13'); static::assertInstanceOf(Version::class, $version); - static::assertSame('v5.7.14', $version->version); + static::assertSame('5.7.14', $version->version); } public function testCheckUpdateReturnsVersionWithNewPreRelease(): void @@ -151,7 +151,7 @@ public function testCheckUpdateReturnsVersionWithNewPreRelease(): void $version = $updateChecker->checkUpdate('5.7.13'); static::assertInstanceOf(Version::class, $version); - static::assertSame('v5.7.14', $version->version); + static::assertSame('5.7.14', $version->version); } public function testCheckUpdateReturnsVersionOfPreReleaseWithPreRelease(): void @@ -168,7 +168,7 @@ public function testCheckUpdateReturnsVersionOfPreReleaseWithPreRelease(): void $version = $updateChecker->checkUpdate('5.7.13'); static::assertInstanceOf(Version::class, $version); - static::assertSame('v5.7.15', $version->version); + static::assertSame('5.7.15', $version->version); } public function testCheckUpdateReturnsVersionOfNormalReleaseWithoutPreRelease(): void @@ -185,7 +185,7 @@ public function testCheckUpdateReturnsVersionOfNormalReleaseWithoutPreRelease(): $version = $updateChecker->checkUpdate('5.7.13'); static::assertInstanceOf(Version::class, $version); - static::assertSame('v5.7.14', $version->version); + static::assertSame('5.7.14', $version->version); } private function getSingleVersionJson(string $version, bool $prerelease = false): string