From: Dylan William Hardison Date: Tue, 17 Jul 2018 03:25:27 +0000 (-0400) Subject: Bug 1476052 - Bugzilla mishandles diff attachments that are UTF-8 and contain U+FFFF X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac995e4ebf84924b6be9dba3fe8358f0a5857ad1;p=thirdparty%2Fbugzilla.git Bug 1476052 - Bugzilla mishandles diff attachments that are UTF-8 and contain U+FFFF --- diff --git a/Bugzilla/PatchReader/Raw.pm b/Bugzilla/PatchReader/Raw.pm index 0a8387a15..bb5a6cefd 100644 --- a/Bugzilla/PatchReader/Raw.pm +++ b/Bugzilla/PatchReader/Raw.pm @@ -16,6 +16,7 @@ package Bugzilla::PatchReader::Raw; use 5.10.1; use strict; use warnings; +no warnings 'utf8'; use Bugzilla::PatchReader::Base; diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 9eea0d3dd..8cf91052e 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -624,6 +624,7 @@ sub create { # and newlines/carriage returns escaped for use in JS strings. js => sub { my ($var) = @_; + no warnings 'utf8'; $var =~ s/([\\\'\"\/])/\\$1/g; $var =~ s/\n/\\n/g; $var =~ s/\r/\\r/g; @@ -639,6 +640,7 @@ sub create { # for details. json => sub { my ($var) = @_; + no warnings 'utf8'; $var =~ s/([\\\"\/])/\\$1/g; $var =~ s/\n/\\n/g; $var =~ s/\r/\\r/g; diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index a1316c7ef..a8477a62d 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -105,6 +105,7 @@ my %html_quote = ( # Bug 319331: Handle BiDi disruptions. sub html_quote { my $var = shift; + no warnings 'utf8'; $var =~ s/([&<>"@])/$html_quote{$1}/g; state $use_utf8 = Bugzilla->params->{'utf8'};