Skip to content

Commit

Permalink
DQA-7826: Hotfix for components security check (#695)
Browse files Browse the repository at this point in the history
  • Loading branch information
crgomes authored Sep 22, 2023
1 parent 94cae6b commit a720403
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Toolkit change log

## Version 9.13.1 | 10.3.1
- DQA-7826: Hotfix for components security check.

## Version 9.13.0 | 10.3.0
- DQA-7528: Allow to block access to files in htaccess.
- DQA-7379: Force max-age in Cache-Control headers.
Expand Down
2 changes: 1 addition & 1 deletion phpdoc.dist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<paths>
<output>docs</output>
</paths>
<version number="10.3.0">
<version number="10.3.1">
<folder>latest</folder>
<api>
<source dsn=".">
Expand Down
11 changes: 5 additions & 6 deletions src/TaskRunner/Commands/ComponentCheckCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,18 +451,17 @@ protected function componentInsecure(array $modules)
if (!empty($data['advisories']) && is_array($data['advisories'])) {
// Each package might have multiple issues, we take the first.
foreach ($data['advisories'] as $advisory) {
$packageName = $advisory[0]['packageName'];
if (!isset($packages[$packageName])) {
$packages[] = $advisory[0];
$packages[$packageName]['version'] = ToolCommands::getPackagePropertyFromComposer($packageName);
}
$firstAdvisory = array_pop($advisory);
$packageName = $firstAdvisory['packageName'];
$packages[$packageName]['title'] = $firstAdvisory['title'];
$packages[$packageName]['version'] = ToolCommands::getPackagePropertyFromComposer($packageName);
}
}
}

$messages = [];
foreach ($packages as $name => $package) {
$msg = "Package $name has a security update, please update to a safe version.";
$msg = "Package $name has a security update, please update to a safe version. (" . $package['title'] . ")";
if (!empty($modules[$name]['secure'])) {
if (Semver::satisfies($package['version'], $modules[$name]['secure'])) {
$messages[] = "$msg (Version marked as secure)";
Expand Down
2 changes: 1 addition & 1 deletion src/Toolkit.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class Toolkit
/**
* Constant holding the current version.
*/
public const VERSION = '10.3.0';
public const VERSION = '10.3.1';

/**
* Returns the Toolkit root.
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/commands/tool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
[WARNING] Failed to get Toolkit version from composer.lock.
Minimum version: ^10
Current version: 10.3.0
Current version: 10.3.1
Version check: OK
- command: toolkit:check-version
Expand All @@ -99,7 +99,7 @@
> Checking Toolkit version:
Minimum version: ^10
Current version: 10.3.0
Current version: 10.3.1
Version check: OK
- command: toolkit:vendor-list
Expand Down

0 comments on commit a720403

Please sign in to comment.