summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Util.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2008-03-28 18:33:13 +0100
committerlpsolit%gmail.com <>2008-03-28 18:33:13 +0100
commit1d08cb2f7abb8d56855ff05d68d3e803b7e66c38 (patch)
tree973191003f9580d5d393cc91f28a88fedd8c1fb8 /Bugzilla/Util.pm
parentc57e5fa6c35dab9ad851c5593ebed9dcd968212b (diff)
downloadbugzilla-1d08cb2f7abb8d56855ff05d68d3e803b7e66c38.tar.gz
bugzilla-1d08cb2f7abb8d56855ff05d68d3e803b7e66c38.tar.xz
Bug 423439: show_bug.cgi crashes when wrapping comments which contain Unicode characters and tabs in them - Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=mkanat
Diffstat (limited to 'Bugzilla/Util.pm')
-rw-r--r--Bugzilla/Util.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm
index 1471295fc..da41008e1 100644
--- a/Bugzilla/Util.pm
+++ b/Bugzilla/Util.pm
@@ -312,6 +312,11 @@ sub wrap_comment {
$wrappedcomment .= ($line . "\n");
}
else {
+ # Due to a segfault in Text::Tabs::expand() when processing tabs with
+ # Unicode (see http://rt.perl.org/rt3/Public/Bug/Display.html?id=52104),
+ # we have to remove tabs before processing the comment. This restriction
+ # can go away when we require Perl 5.8.9 or newer.
+ $line =~ s/\t/ /g;
$wrappedcomment .= (wrap('', '', $line) . "\n");
}
}