Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Add SS-2023-001 style security commits. #246

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Model/Changelog/ChangelogItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,14 @@ public function getShortHash()
*/
public function getSecurityCVE()
{
// New CVE style identifiers
// New CVE style identifiers (e.g. CVE-2023-32302)
if (preg_match('/^\[(?<cve>CVE-(\d){4}-(\d){4,})\]/i', $this->getRawMessage(), $matches)) {
return strtolower($matches['cve']);
}
// Non-CVE style identifiers (e.g. SS-2023-001)
if (preg_match('/^\[(?<ss>SS-(\d){4}-(\d){3})\]/i', $this->getRawMessage(), $matches)) {
return strtolower($matches['ss']);
}
}

/**
Expand Down
8 changes: 4 additions & 4 deletions tests/Model/Changelog/ChangelogItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ public function messageProvider()
[
'[SS-2047-123] Lower doubt with cow coverage',
'[SS-2047-123] Lower doubt with cow coverage',
'Other changes'
'Security'
],
[
'[ss-2047-123] Lower doubt with cow coverage',
'[ss-2047-123] Lower doubt with cow coverage',
'Other changes'
'Security'
],
['[SS-2047-123]: Logins now use passwords', '[SS-2047-123]: Logins now use passwords', 'Other changes'],
['[ss-2047-123]: Logins now use passwords', '[ss-2047-123]: Logins now use passwords', 'Other changes'],
['[SS-2047-123]: Logins now use passwords', '[SS-2047-123]: Logins now use passwords', 'Security'],
['[ss-2047-123]: Logins now use passwords', '[ss-2047-123]: Logins now use passwords', 'Security'],
['[CVE-1234-56789]: Fix something serious', 'Fix something serious', 'Security'],
['[CVE-1234-12345] Remove admin login backdoor', 'Remove admin login backdoor', 'Security'],
['[cve-1234-123456] added admin login backdoor', 'added admin login backdoor', 'Security'],
Expand Down