From 4a02768591d04e28c21bd675635e74246e8602ec Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 9 Sep 2020 11:44:05 +0200 Subject: [PATCH 1/2] Fail hard if an invalid root alias is detected --- src/Composer/Package/Loader/RootPackageLoader.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Composer/Package/Loader/RootPackageLoader.php b/src/Composer/Package/Loader/RootPackageLoader.php index 2115d7378..32118b113 100644 --- a/src/Composer/Package/Loader/RootPackageLoader.php +++ b/src/Composer/Package/Loader/RootPackageLoader.php @@ -190,6 +190,8 @@ class RootPackageLoader extends ArrayLoader 'alias' => $match[2], 'alias_normalized' => $this->versionParser->normalize($match[2], $reqVersion), ); + } elseif (strpos($reqVersion, ' as ') !== false) { + throw new \UnexpectedValueException('Invalid alias definition in "'.$reqName.'": "'.$reqVersion.'". Aliases should be in the form "exact-version as other-exact-version".'); } } From 44508319d1e8819fdf538f112703056fa691d035 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 9 Sep 2020 11:46:28 +0200 Subject: [PATCH 2/2] Update semver and changelog --- CHANGELOG.md | 6 ++++++ composer.lock | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 255fb18b4..d79afcbdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### [1.10.13] 2020-09-09 + + * Fixed regressions with old version validation + * Fixed invalid root aliases not being reported + ### [1.10.12] 2020-09-08 * Fixed regressions with old version validation @@ -889,6 +894,7 @@ * Initial release +[1.10.13]: https://github.com/composer/composer/compare/1.10.12...1.10.13 [1.10.12]: https://github.com/composer/composer/compare/1.10.11...1.10.12 [1.10.11]: https://github.com/composer/composer/compare/1.10.10...1.10.11 [1.10.10]: https://github.com/composer/composer/compare/1.10.9...1.10.10 diff --git a/composer.lock b/composer.lock index c395ad5fd..12a005e8d 100644 --- a/composer.lock +++ b/composer.lock @@ -83,16 +83,16 @@ }, { "name": "composer/semver", - "version": "1.6.0", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "9787c20e39dfeea673665abee0679c73ba67105d" + "reference": "114f819054a2ea7db03287f5efb757e2af6e4079" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/9787c20e39dfeea673665abee0679c73ba67105d", - "reference": "9787c20e39dfeea673665abee0679c73ba67105d", + "url": "https://api.github.com/repos/composer/semver/zipball/114f819054a2ea7db03287f5efb757e2af6e4079", + "reference": "114f819054a2ea7db03287f5efb757e2af6e4079", "shasum": "" }, "require": { @@ -154,7 +154,7 @@ "type": "tidelift" } ], - "time": "2020-09-08T20:42:08+00:00" + "time": "2020-09-09T09:34:06+00:00" }, { "name": "composer/spdx-licenses",