From 06fa257080ab8de7986ad5debbf317eddf5608e7 Mon Sep 17 00:00:00 2001 From: Alex Lewis Date: Tue, 10 Dec 2013 16:40:10 +0000 Subject: [PATCH] issue-350: Fixes issue when an apostrophe is present in a User's name --- src/main/java/com/gitblit/wicket/charting/GoogleLineChart.java | 2 +- src/main/java/com/gitblit/wicket/charting/GooglePieChart.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gitblit/wicket/charting/GoogleLineChart.java b/src/main/java/com/gitblit/wicket/charting/GoogleLineChart.java index ca894777..44da20ab 100644 --- a/src/main/java/com/gitblit/wicket/charting/GoogleLineChart.java +++ b/src/main/java/com/gitblit/wicket/charting/GoogleLineChart.java @@ -41,7 +41,7 @@ public class GoogleLineChart extends GoogleChart { for (int i = 0; i < values.size(); i++) { ChartValue value = values.get(i); - line(sb, MessageFormat.format("{0}.setValue({1,number,0}, 0, ''{2}'');", dName, i, + line(sb, MessageFormat.format("{0}.setValue({1,number,0}, 0, \"{2}\");", dName, i, value.name)); line(sb, MessageFormat.format("{0}.setValue({1,number,0}, 1, {2,number,0.0});", dName, i, value.value)); diff --git a/src/main/java/com/gitblit/wicket/charting/GooglePieChart.java b/src/main/java/com/gitblit/wicket/charting/GooglePieChart.java index 546a2a9b..71191664 100644 --- a/src/main/java/com/gitblit/wicket/charting/GooglePieChart.java +++ b/src/main/java/com/gitblit/wicket/charting/GooglePieChart.java @@ -65,7 +65,7 @@ public class GooglePieChart extends GoogleChart { if (i < values.size() - 1) { colors.append(','); } - line(sb, MessageFormat.format("{0}.setValue({1,number,0}, 0, ''{2}'');", dName, i, + line(sb, MessageFormat.format("{0}.setValue({1,number,0}, 0, \"{2}\");", dName, i, value.name)); line(sb, MessageFormat.format("{0}.setValue({1,number,0}, 1, {2,number,0.0});", dName, i, value.value)); -- 2.39.5