Skip to content

Commit

Permalink
Make sure that names with wildcards which are not preceded by dots ar…
Browse files Browse the repository at this point in the history
…e also seen as package names and not version constraints
  • Loading branch information
Seldaek committed Aug 25, 2021
1 parent 5e75017 commit 73c109c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Composer/Package/Version/VersionParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function parseNameVersionPairs(array $pairs)

for ($i = 0, $count = count($pairs); $i < $count; $i++) {
$pair = preg_replace('{^([^=: ]+)[=: ](.*)$}', '$1 $2', trim($pairs[$i]));
if (false === strpos($pair, ' ') && isset($pairs[$i + 1]) && false === strpos($pairs[$i + 1], '/') && !PlatformRepository::isPlatformPackage($pairs[$i + 1])) {
if (false === strpos($pair, ' ') && isset($pairs[$i + 1]) && false === strpos($pairs[$i + 1], '/') && !preg_match('{(?<!\.)\*}', $pairs[$i + 1]) && !PlatformRepository::isPlatformPackage($pairs[$i + 1])) {
$pair .= ' '.$pairs[$i + 1];
$i++;
}
Expand Down

0 comments on commit 73c109c

Please sign in to comment.