summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2014-02-25 21:42:13 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2014-02-25 21:42:13 +0100
commit0446b5c7b035bcfe9d54d863e8de3864d712c542 (patch)
tree15093889bbc585f304771a94386273264b6fd4a6 /Bugzilla/Bug.pm
parentdee2aa7187553971fb549be116d51c7ff69ee607 (diff)
downloadbugzilla-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.pm6
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;