]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 542464: Dependency graphs cannot be displayed when bug summaries contain UTF8...
authorFrédéric Buclin <LpSolit@gmail.com>
Mon, 8 Mar 2010 00:50:02 +0000 (01:50 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Mon, 8 Mar 2010 00:50:02 +0000 (01:50 +0100)
r/a=mkanat

showdependencygraph.cgi

index 9b3437ebc840e7011087f62d291214e88cb1c844..e73b1f6335fadbd35ab53e00d0d5e873c4dfe383 100755 (executable)
@@ -58,7 +58,7 @@ local our (%seen, %edgesdone, %bugtitles);
 sub CreateImagemap {
     my $mapfilename = shift;
     my $map = "<map name=\"imagemap\">\n";
-    my $default;
+    my $default = "";
 
     open MAP, "<$mapfilename";
     while(my $line = <MAP>) {
@@ -206,6 +206,10 @@ foreach my $k (keys(%seen)) {
     my @params;
 
     if ($summary ne "" && $cgi->param('showsummary')) {
+        # Wide characters cause GraphViz to die.
+        if (Bugzilla->params->{'utf8'}) {
+            utf8::encode($summary) if utf8::is_utf8($summary);
+        }
         $summary =~ s/([\\\"])/\\$1/g;
         push(@params, qq{label="$k\\n$summary"});
     }