summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Comment.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/Comment.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/Comment.pm')
-rw-r--r--Bugzilla/Comment.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/Bugzilla/Comment.pm b/Bugzilla/Comment.pm
index 0dada24cf..238770d57 100644
--- a/Bugzilla/Comment.pm
+++ b/Bugzilla/Comment.pm
@@ -429,7 +429,10 @@ sub _check_thetext {
# without any problem. So we need to replace these characters if we use MySQL,
# else the comment is truncated.
# XXX - Once we use utf8mb4 for comments, this hack for MySQL can go away.
- if (Bugzilla->dbh->isa('Bugzilla::DB::Mysql')) {
+ state $is_mysql = Bugzilla->dbh->isa('Bugzilla::DB::Mysql') ? 1 : 0;
+ if ($is_mysql) {
+ # Perl 5.13.8 and older complain about non-characters.
+ no warnings 'utf8';
$thetext =~ s/([\x{10000}-\x{10FFFF}])/"\x{FDD0}[" . uc(sprintf('U+%04x', ord($1))) . "]\x{FDD1}"/eg;
}