Skip to content

Commit a1c2857

Browse files
committed
Fixing pm:security to properly identify security updates.
1 parent 51bf721 commit a1c2857

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/Commands/pm/SecurityUpdateCommands.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,19 @@ public function security()
7878
'min-version' => $min_version,
7979
];
8080
}
81-
} else {
81+
}
82+
// Compare exact versions that are insecure.
83+
elseif (preg_match('/^[[:digit:]](?![-*><=~ ])/', $conflict_constraint)) {
84+
$exact_version = $conflict_constraint;
85+
if (Comparator::equalTo($package['version'], $exact_version)) {
86+
$this->securityUpdates[$name] = [
87+
'name' => $name,
88+
'version' => $package['version'],
89+
'min-version' => $exact_version,
90+
];
91+
}
92+
}
93+
else {
8294
$this->logger()->warning("Could not parse drupal-security-advisories conflicting version constraint $conflict_constraint for package $name.");
8395
}
8496
}

0 commit comments

Comments
 (0)