Demon has submitted this change and it was merged.
Change subject: Add CVE linker
......................................................................
Add CVE linker
Change-Id: I47c26079a94b6ac2cb62b1791a78ceda3eefd5ae
---
M bugzilla-4.2/extensions/Wikimedia/Extension.pm
1 file changed, 13 insertions(+), 2 deletions(-)
Approvals:
Demon: Verified; Looks good to me, approved
Matmarex: Looks good to me, but someone else must approve
diff --git a/bugzilla-4.2/extensions/Wikimedia/Extension.pm
b/bugzilla-4.2/extensions/Wikimedia/Extension.pm
index 9ca5125..e09a29a 100644
--- a/bugzilla-4.2/extensions/Wikimedia/Extension.pm
+++ b/bugzilla-4.2/extensions/Wikimedia/Extension.pm
@@ -27,7 +27,7 @@
our $VERSION = '0.01';
-# See the documentation of Bugzilla::Hook ("perldoc Bugzilla::Hook"
+# See the documentation of Bugzilla::Hook ("perldoc Bugzilla::Hook"
# in the bugzilla directory) for a list of all available hooks.
sub install_update_db {
my ($self, $args) = @_;
@@ -68,12 +68,18 @@
replace => \&_createGitCommitLink
};
+ my $replacerCVE = {
+ match => qr{\b(CVE-\d{4}-\d+)},
+ replace => \&_createCVELink
+ };
+
push( @$regexes, $replacerWP );
push( @$regexes, $replacerCR );
push( @$regexes, $replacerRT );
push( @$regexes, $replacerGerritChangeset );
push( @$regexes, $replacerGerritChangeId );
push( @$regexes, $replacerGitCommit );
+ push( @$regexes, $replacerCVE );
}
sub _createWikipediaLink {
@@ -107,5 +113,10 @@
my $rev_link = "<a href=\"https://gerrit.wikimedia.org/r/#q,$1,n,z\"
title=\"Git commit $1\">$1</a>";
return $rev_link;
};
-
+
+sub _createCVELink {
+ my $cve_link = "<a
href=\"https://cve.mitre.org/cgi-bin/cvename.cgi?name=$1\" title=\"$1\">$1</a>";
+ return $cve_link;
+}
+
__PACKAGE__->NAME;
--
To view, visit https://gerrit.wikimedia.org/r/52251
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I47c26079a94b6ac2cb62b1791a78ceda3eefd5ae
Gerrit-PatchSet: 2
Gerrit-Project: wikimedia/bugzilla/modifications
Gerrit-Branch: master
Gerrit-Owner: Reedy <[email protected]>
Gerrit-Reviewer: Aklapper <[email protected]>
Gerrit-Reviewer: Demon <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>
Gerrit-Reviewer: Matmarex <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits