Skip to content
This repository was archived by the owner on Nov 14, 2019. It is now read-only.

Commit 31765ca

Browse files
committed
Made comparisons case insensitive because Composer doesn't differentiate 'BETA1' from 'beta1'
1 parent 9b3cdc1 commit 31765ca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Installer/NewCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ protected function checkSymfonyVersionIsInstallable()
111111
}
112112

113113
// validate semver syntax
114-
if (!preg_match('/^2\.\d(?:\.\d{1,2})?(-(dev|BETA\d*))?$/', $this->version)) {
114+
if (!preg_match('/^2\.\d(?:\.\d{1,2})?(-(dev|BETA\d*))?$/i', $this->version)) {
115115
throw new \RuntimeException('The Symfony version should be 2.N or 2.N.M, where N = 0..9 and M = 0..99. The special "-dev" or "-BETA" suffixes are also supported.');
116116
}
117117

@@ -171,7 +171,7 @@ protected function checkSymfonyVersionIsInstallable()
171171
}
172172

173173
// "-dev" versions are not supported because Symfony doesn't provide packages for them
174-
if (preg_match('/^.*\-dev$/', $this->version)) {
174+
if (preg_match('/^.*\-dev$/i', $this->version)) {
175175
throw new \RuntimeException(sprintf(
176176
"The selected version (%s) cannot be installed because it hasn't\n".
177177
"been published as a package yet. Read the following article for\n".
@@ -183,7 +183,7 @@ protected function checkSymfonyVersionIsInstallable()
183183
}
184184

185185
// warn the user when downloading an unstable version
186-
if (preg_match('/^.*\-BETA\d*$/', $this->version)) {
186+
if (preg_match('/^.*\-BETA\d*$/i', $this->version)) {
187187
$this->output->writeln("\n <bg=red> WARNING </> You are downloading an unstable Symfony version.");
188188
}
189189

0 commit comments

Comments
 (0)