X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FCGI.pm;h=d51b9be0a469c5503f4e3648964c36bb2bb31e27;hb=bec036b7465a66ad8fea842d01ce4cd53eed146f;hp=d305aed7e2724261fa1c3723846bc378e0351a02;hpb=f3e9030c5d22122dc4e7a4713b1c3413592a0d02;p=debbugs.git
diff --git a/Debbugs/CGI.pm b/Debbugs/CGI.pm
index d305aed..d51b9be 100644
--- a/Debbugs/CGI.pm
+++ b/Debbugs/CGI.pm
@@ -196,7 +196,7 @@ width and height are passed.
sub version_url{
my %params = validate_with(params => \@_,
- spec => {package => {type => SCALAR,
+ spec => {package => {type => SCALAR|ARRAYREF,
},
found => {type => ARRAYREF,
default => [],
@@ -400,11 +400,15 @@ sub package_links {
}
my @links = ();
for my $type (qw(src package)) {
- push @links, map {(munge_url('pkgreport.cgi?',
+ push @links, map {my $t_type = $type;
+ if ($_ =~ s/^src://) {
+ $t_type = 'src';
+ }
+ (munge_url('pkgreport.cgi?',
%options,
- $type => $_,
+ $t_type => $_,
),
- ($type eq 'src'?'src:':'').$_);
+ ($t_type eq 'src'?'src:':'').$_);
} make_list($param{$type}) if exists $param{$type};
}
for my $type (qw(maint owner submitter correspondent)) {
@@ -536,8 +540,8 @@ the split links with commas and spaces.
sub maybelink {
my ($links,$regex,$join) = @_;
if (not defined $regex and not defined $join) {
- $links =~ s{((?:ftp|http|https)://[\S~-]+?/?)([\)\'\:\.\,]?(?:\s|\.<|$))}
- {q().html_escape($1).q().$2}geimo;
+ $links =~ s{(.*?)((?:(?:ftp|http|https)://[\S~-]+?/?)?)([\)\'\:\.\,]?(?:\s|\.<|$))}
+ {html_escape($1).(length $2?q().html_escape($2).q():'').html_escape($3)}geimo;
return $links;
}
$join = ' ' if not defined $join;