From 172414a1f0ef04ae6a7aa747f3d48ad7b0294512 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 14 Nov 2012 10:55:51 +0100 Subject: [PATCH] Add support for ~/+ in addition to - as separator between PHP version and build details, fixes #1322 --- src/Composer/Repository/PlatformRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index c6affe9a2..1cf11c47a 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -30,7 +30,7 @@ class PlatformRepository extends ArrayRepository $prettyVersion = PHP_VERSION; $version = $versionParser->normalize($prettyVersion); } catch (\UnexpectedValueException $e) { - $prettyVersion = preg_replace('#^(.+?)(-.+)?$#', '$1', PHP_VERSION); + $prettyVersion = preg_replace('#^([^~+-]+).*$#', '$1', PHP_VERSION); $version = $versionParser->normalize($prettyVersion); }