summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-07-17 05:25:27 +0200
committerGitHub <noreply@github.com>2018-07-17 05:25:27 +0200
commitac995e4ebf84924b6be9dba3fe8358f0a5857ad1 (patch)
tree66108ca7e4c20218653b7fcdc607b900f1c9a467 /Bugzilla
parent77dcbc804df9133207dd112a1a99821f66b2b9f7 (diff)
downloadbugzilla-ac995e4ebf84924b6be9dba3fe8358f0a5857ad1.tar.gz
bugzilla-ac995e4ebf84924b6be9dba3fe8358f0a5857ad1.tar.xz
Bug 1476052 - Bugzilla mishandles diff attachments that are UTF-8 and contain U+FFFF
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/PatchReader/Raw.pm1
-rw-r--r--Bugzilla/Template.pm2
-rw-r--r--Bugzilla/Util.pm1
3 files changed, 4 insertions, 0 deletions
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'};