diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2014-02-25 21:42:13 +0100 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2014-02-25 21:42:13 +0100 |
commit | 0446b5c7b035bcfe9d54d863e8de3864d712c542 (patch) | |
tree | 15093889bbc585f304771a94386273264b6fd4a6 /Bugzilla/Bug.pm | |
parent | dee2aa7187553971fb549be116d51c7ff69ee607 (diff) | |
download | bugzilla-0446b5c7b035bcfe9d54d863e8de3864d712c542.tar.gz bugzilla-0446b5c7b035bcfe9d54d863e8de3864d712c542.tar.xz |
Bug 405011: Text is cut off when containing Unicode supplementary characters (outside BMP) with MySQL as backend
r=gerv a=justdave
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r-- | Bugzilla/Bug.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 367804862..73b50018a 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -3412,9 +3412,15 @@ 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; 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; } # Some bugs may have no comments when upgrading old installations. Bugzilla::Comment->preload($self->{'comments'}) if $count; |