From 22dd7abc8d6feb5939f372411e67c3e5b698318d Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 15 Oct 2011 12:40:35 +0000 Subject: [PATCH] * remove illegal characters from label --- source/net/sourceforge/filebot/Analytics.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/net/sourceforge/filebot/Analytics.java b/source/net/sourceforge/filebot/Analytics.java index e9d13ace..cf0924dd 100644 --- a/source/net/sourceforge/filebot/Analytics.java +++ b/source/net/sourceforge/filebot/Analytics.java @@ -63,7 +63,16 @@ public class Analytics { if (!tracker.isEnabled()) return; - tracker.trackEvent(category, action, label, value); + tracker.trackEvent(normalize(category), normalize(action), normalize(label), value); + } + + + private static String normalize(String label) { + if (label == null) + return null; + + // trim braces + return label.replaceAll("[*()]", "").trim(); }