From e10f6628afa13ccb4c964584ddb791cf296b9b6a Mon Sep 17 00:00:00 2001 From: Dominik Hassler Date: Fri, 31 May 2024 15:40:50 +0000 Subject: [PATCH] fenix: limit the maximum number of digits for issue patterns --- lib/Fenix/Model/Handler/Issue/Gerrit.pm | 2 +- lib/Fenix/Model/Handler/Issue/IPD.pm | 2 +- lib/Fenix/Model/Handler/Issue/Illumos.pm | 4 ++-- lib/Fenix/Model/Handler/Issue/SmartOS.pm | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Fenix/Model/Handler/Issue/Gerrit.pm b/lib/Fenix/Model/Handler/Issue/Gerrit.pm index 2da55fd..8d94829 100644 --- a/lib/Fenix/Model/Handler/Issue/Gerrit.pm +++ b/lib/Fenix/Model/Handler/Issue/Gerrit.pm @@ -20,7 +20,7 @@ sub issues($self, $msg) { my $urlre = qr!\b\Q$baseurl\E/c/illumos-gate/\+/(\d+)\b!; for ($msg) { return ([ /$urlre/g ], { url => 1 }) if /$urlre/; - return [ /\b(\d{2,})\b/g ] if /\bcode\b/i; + return [ /\b(\d{2,5})\b/g ] if /\bcode\b/i; } return []; diff --git a/lib/Fenix/Model/Handler/Issue/IPD.pm b/lib/Fenix/Model/Handler/Issue/IPD.pm index 7c37b38..15bf74f 100644 --- a/lib/Fenix/Model/Handler/Issue/IPD.pm +++ b/lib/Fenix/Model/Handler/Issue/IPD.pm @@ -19,7 +19,7 @@ sub issues($self, $msg) { my $urlre = qr!\b\Q$baseurl\E/illumos/ipd/\S+/ipd/0+(\d+)/README\.md\b!i; for ($msg) { return ([ /$urlre/g ], { url => 1 }) if /$urlre/; - return [ /\bIPD[-\s]*(\d+)\b/ig ]; + return [ /\bIPD[-\s]*(\d{1,3})\b/ig ]; } return []; diff --git a/lib/Fenix/Model/Handler/Issue/Illumos.pm b/lib/Fenix/Model/Handler/Issue/Illumos.pm index 390afbc..39bd6e0 100644 --- a/lib/Fenix/Model/Handler/Issue/Illumos.pm +++ b/lib/Fenix/Model/Handler/Issue/Illumos.pm @@ -19,8 +19,8 @@ sub issues($self, $msg) { my $urlre = qr!\b\Q$baseurl\E/issues/(\d+)\b!; for ($msg) { return ([ /$urlre/g ], { url => 1 }) if /$urlre/; - return [ /\b(\d{3,})\b/g ] if /\b(?:illumos|issue)\b/i; - return [ /#(\d{3,})\b/g ]; + return [ /\b(\d{3,5})\b/g ] if /\b(?:illumos|issue)\b/i; + return [ /#(\d{3,5})\b/g ]; } return []; diff --git a/lib/Fenix/Model/Handler/Issue/SmartOS.pm b/lib/Fenix/Model/Handler/Issue/SmartOS.pm index b691bb2..b140ff3 100644 --- a/lib/Fenix/Model/Handler/Issue/SmartOS.pm +++ b/lib/Fenix/Model/Handler/Issue/SmartOS.pm @@ -15,7 +15,7 @@ sub issues($self, $msg) { my $urlre = qr!\b\Q$baseurl\E/bugview/([A-Z]+-\d+)\b!; for ($msg) { return ([ /$urlre/g ], { url => 1 }) if /$urlre/; - return [ /\b([A-Z]+-\d+)\b/g ]; + return [ /\b([A-Z]+-\d{1,5})\b/g ]; } return [];