clone => [qw(clone_bug)],
archive => [qw(bug_archive bug_unarchive),
],
+ limit => [qw(check_limit)],
log => [qw(append_action_to_log),
],
);
}
use Debbugs::Config qw(:config);
-use Debbugs::Common qw(:lock buglog :misc get_hashname sort_versions);
+use Debbugs::Common qw(:lock buglog :misc get_hashname sort_versions :utf8);
use Debbugs::Status qw(bug_archiveable :read :hook writebug new_bug splitpackages split_status_fields get_bug_status);
use Debbugs::CGI qw(html_escape);
use Debbugs::Log qw(:misc :write);
use Storable qw(dclone nfreeze);
use List::Util qw(first max);
+use Encode qw(encode_utf8);
use Carp;
$new_locks += $n_locks;
%data = %{$data};
@data = values %data;
- if (not __check_limit(data => [@data],
+ if (not check_limit(data => [@data],
exists $param{limit}?(limit => $param{limit}):(),
transcript => $transcript,
)) {
$nd{$key} = $new_data->{$key};
# $data_diff .= html_escape("$Debbugs::Status::fields{$key}: $new_data->{$key}")."\n";
}
- $data_diff .= html_escape(Data::Dumper->Dump([\%nd],[qw(new_data)]));
+ $data_diff .= html_escape(Data::Dumper->Dump([encode_utf8_structure(\%nd)],[qw(new_data)]));
$data_diff .= "-->\n";
$data_diff .= "<!-- old_data:\n";
my %od;
$od{$key} = $old_data->{$key};
# $data_diff .= html_escape("$Debbugs::Status::fields{$key}: $old_data->{$key}")."\n";
}
- $data_diff .= html_escape(Data::Dumper->Dump([\%od],[qw(old_data)]));
+ $data_diff .= html_escape(Data::Dumper->Dump([encode_utf8_structure(\%od)],[qw(old_data)]));
$data_diff .= "-->\n";
}
my $msg = join('',
(exists $param{command} ?
- "<!-- command:".html_escape($param{command})." -->\n":""
+ "<!-- command:".html_escape(encode_utf8($param{command}))." -->\n":""
),
(length $param{requester} ?
- "<!-- requester: ".html_escape($param{requester})." -->\n":""
+ "<!-- requester: ".html_escape(encode_utf8($param{requester}))." -->\n":""
),
(length $param{request_addr} ?
- "<!-- request_addr: ".html_escape($param{request_addr})." -->\n":""
+ "<!-- request_addr: ".html_escape(encode_utf8($param{request_addr}))." -->\n":""
),
"<!-- time:".time()." -->\n",
$data_diff,
- "<strong>".html_escape($param{action})."</strong>\n");
+ "<strong>".html_escape(encode_utf8($param{action}))."</strong>\n");
if (length $param{requester}) {
- $msg .= "Request was from <code>".html_escape($param{requester})."</code>\n";
+ $msg .= "Request was from <code>".html_escape(encode_utf8($param{requester}))."</code>\n";
}
if (length $param{request_addr}) {
- $msg .= "to <code>".html_escape($param{request_addr})."</code>";
+ $msg .= "to <code>".html_escape(encode_utf8($param{request_addr}))."</code>";
}
if (length $param{desc}) {
- $msg .= ":<br>\n$param{desc}\n";
+ $msg .= ":<br>\n".encode_utf8($param{desc})."\n";
}
else {
$msg .= ".\n";
}
}
}
- if (not __check_limit(data => \@data,
+ if (not check_limit(data => \@data,
exists $param{limit}?(limit => $param{limit}):(),
transcript => $transcript,
)) {
}
-=head2 __check_limit
+=head2 check_limit
- __check_limit(data => \@data, limit => $param{limit});
+ check_limit(data => \@data, limit => $param{limit});
Checks to make sure that bugs match any limits; each entry of @data
=cut
-sub __check_limit{
+sub check_limit{
my %param = validate_with(params => \@_,
spec => {data => {type => ARRAYREF|SCALAR,
},
my $hole_var = {'&bugurl' =>
sub{"$_[0]: ".
'http://'.$config{cgi_domain}.'/'.
- Debbugs::CGI::bug_url($_[0]);
+ Debbugs::CGI::bug_links(bug => $_[0],
+ links_only => 1,
+ );
}
};