summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2014-02-26 11:14:08 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2014-02-26 11:14:08 +0100
commite1056ea952c65e24a0f5240ea6e13ac990299440 (patch)
treede9d4f4a3e6c12d1a8a6ae4d2fe81e52f9700a0b /Bugzilla/Bug.pm
parentb06a5f44ac35f92a28498c90292eef1735df6f7d (diff)
downloadbugzilla-e1056ea952c65e24a0f5240ea6e13ac990299440.tar.gz
bugzilla-e1056ea952c65e24a0f5240ea6e13ac990299440.tar.xz
Remove "Unicode non-character 0xfdd0 is illegal for interchange" warnings thrown by Perl 5.10.1 and 5.12, see bug 405011
r=gerv
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 73b50018a..dd22426bb 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -3412,15 +3412,18 @@ sub comments {
if (!defined $self->{'comments'}) {
$self->{'comments'} = Bugzilla::Comment->match({ bug_id => $self->id });
my $count = 0;
- my $is_mysql = Bugzilla->dbh->isa('Bugzilla::DB::Mysql') ? 1 : 0;
+ state $is_mysql = Bugzilla->dbh->isa('Bugzilla::DB::Mysql') ? 1 : 0;
foreach my $comment (@{ $self->{'comments'} }) {
$comment->{count} = $count++;
$comment->{bug} = $self;
# XXX - hack for MySQL. Convert [U+....] back into its Unicode
# equivalent for characters above U+FFFF as MySQL older than 5.5.3
# cannot store them, see Bugzilla::Comment::_check_thetext().
- $comment->{thetext} =~ s/\x{FDD0}\[U\+((?:[1-9A-F]|10)[0-9A-F]{4})\]\x{FDD1}/chr(hex $1)/eg
- if $is_mysql;
+ if ($is_mysql) {
+ # Perl 5.13.8 and older complain about non-characters.
+ no warnings 'utf8';
+ $comment->{thetext} =~ s/\x{FDD0}\[U\+((?:[1-9A-F]|10)[0-9A-F]{4})\]\x{FDD1}/chr(hex $1)/eg
+ }
}
# Some bugs may have no comments when upgrading old installations.
Bugzilla::Comment->preload($self->{'comments'}) if $count;