1
0
Fork 0

Avoid using str_replace for dev-master replacement as that may be a valid part of a branch name, fixes #9739

pull/9734/head
Jordi Boggiano 2021-03-09 12:08:38 +01:00
parent b451bcb1ac
commit e9d405ff18
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 6 additions and 2 deletions

View File

@ -76,8 +76,12 @@ class VersionParser extends SemverVersionParser
return true;
}
$normalizedFrom = str_replace(array('dev-master', 'dev-trunk', 'dev-default'), VersionParser::DEFAULT_BRANCH_ALIAS, $normalizedFrom);
$normalizedTo = str_replace(array('dev-master', 'dev-trunk', 'dev-default'), VersionParser::DEFAULT_BRANCH_ALIAS, $normalizedTo);
if (in_array($normalizedFrom, array('dev-master', 'dev-trunk', 'dev-default'), true)) {
$normalizedFrom = VersionParser::DEFAULT_BRANCH_ALIAS;
}
if (in_array($normalizedTo, array('dev-master', 'dev-trunk', 'dev-default'), true)) {
$normalizedTo = VersionParser::DEFAULT_BRANCH_ALIAS;
}
if (strpos($normalizedFrom, 'dev-') === 0 || strpos($normalizedTo, 'dev-') === 0) {
return true;