From 0133d9950118fd22d8380f47c07c2d1c425ec6f0 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Tue, 19 Sep 2023 09:57:52 +1200 Subject: [PATCH] FIX Add SS-2023-001 style security commits. Noticed this in passing while reviewing another change --- src/Model/Changelog/ChangelogItem.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Model/Changelog/ChangelogItem.php b/src/Model/Changelog/ChangelogItem.php index 956aa08..ead7514 100644 --- a/src/Model/Changelog/ChangelogItem.php +++ b/src/Model/Changelog/ChangelogItem.php @@ -301,10 +301,14 @@ public function getShortHash() */ public function getSecurityCVE() { - // New CVE style identifiers - if (preg_match('/^\[(?CVE-(\d){4}-(\d){4,})\]/i', $this->getRawMessage(), $matches)) { + // New CVE style identifiers (e.g. CVE-2023-32302) + if (preg_match('/^\[(?(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-(\d){4}-(\d){3}))\]/i', $this->getRawMessage(), $matches)) { + return strtolower($matches['ss']); + } } /**