X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FControl.pm;h=95876245ba215b59ffe4e37682af88bf0e2db0c2;hb=04265c83beff7e1ccb28a88ff7257fe36b2fc45d;hp=39e6648bbe8478aea8e28b07e454007f0c8f4e3d;hpb=b589eb07e8c620e6daa2ac0dcd65f7d68f242814;p=debbugs.git diff --git a/Debbugs/Control.pm b/Debbugs/Control.pm index 39e6648..9587624 100644 --- a/Debbugs/Control.pm +++ b/Debbugs/Control.pm @@ -110,7 +110,8 @@ BEGIN{ } use Debbugs::Config qw(:config); -use Debbugs::Common qw(:lock buglog :misc get_hashname sort_versions :utf8); +use Debbugs::Common qw(:lock buglog :misc get_hashname sort_versions); +use Debbugs::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); @@ -1578,7 +1579,11 @@ sub set_found { if (not @svers) { @svers = $version; } - else { + elsif (not grep {$version eq $_} @svers) { + # The $version was not equal to one of the source + # versions, so it's probably unqualified (or just + # wrong). Delete it, and use the source versions + # instead. if (exists $found_versions{$version}) { delete $found_versions{$version}; $found_removed{$version} = 1; @@ -1591,7 +1596,7 @@ sub set_found { } # if the found we are adding matches any fixed # versions, remove them - my @temp = grep m{(^|/)\Q$sver\E}, keys %fixed_versions; + my @temp = grep m{(^|/)\Q$sver\E$}, keys %fixed_versions; delete $fixed_versions{$_} for @temp; $fixed_removed{$_} = 1 for @temp; } @@ -1615,7 +1620,7 @@ sub set_found { # in the case of removal, we only concern ourself with # the version passed, not the source version it maps # to - my @temp = grep m{(^|/)\Q$version\E}, keys %found_versions; + my @temp = grep m{(?:^|/)\Q$version\E$}, keys %found_versions; delete $found_versions{$_} for @temp; $found_removed{$_} = 1 for @temp; } @@ -3433,25 +3438,25 @@ sub append_action_to_log{ } my $msg = join('', (exists $param{command} ? - "\n":"" + "\n":"" ), (length $param{requester} ? - "\n":"" + "\n":"" ), (length $param{request_addr} ? - "\n":"" + "\n":"" ), "\n", $data_diff, - "".html_escape(encode_utf8($param{action}))."\n"); + "".html_escape(encode_utf8_safely($param{action}))."\n"); if (length $param{requester}) { - $msg .= "Request was from ".html_escape(encode_utf8($param{requester}))."\n"; + $msg .= "Request was from ".html_escape(encode_utf8_safely($param{requester}))."\n"; } if (length $param{request_addr}) { - $msg .= "to ".html_escape(encode_utf8($param{request_addr})).""; + $msg .= "to ".html_escape(encode_utf8_safely($param{request_addr})).""; } if (length $param{desc}) { - $msg .= ":
\n".encode_utf8($param{desc})."\n"; + $msg .= ":
\n".encode_utf8_safely($param{desc})."\n"; } else { $msg .= ".\n";