mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-04 23:48:42 +01:00
Escaped backslashes in names (json)
This commit is contained in:
parent
20ee5c2533
commit
aebf6c0b25
@ -28,6 +28,7 @@ import com.djrapitops.plan.extension.icon.Color;
|
|||||||
import com.djrapitops.plan.extension.implementation.results.*;
|
import com.djrapitops.plan.extension.implementation.results.*;
|
||||||
import com.djrapitops.plan.settings.locale.Locale;
|
import com.djrapitops.plan.settings.locale.Locale;
|
||||||
import com.djrapitops.plan.settings.locale.lang.HtmlLang;
|
import com.djrapitops.plan.settings.locale.lang.HtmlLang;
|
||||||
|
import org.apache.commons.text.StringEscapeUtils;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@ -141,15 +142,13 @@ public class PlayersTableJSONParser {
|
|||||||
|
|
||||||
Html link = openPlayerPageInNewTab ? Html.LINK_EXTERNAL : Html.LINK;
|
Html link = openPlayerPageInNewTab ? Html.LINK_EXTERNAL : Html.LINK;
|
||||||
|
|
||||||
dataJSON
|
dataJSON.append(makeDataEntry(link.parse(url, StringEscapeUtils.escapeHtml4(name)), "name")).append(',') // Backslashes escaped to prevent json errors
|
||||||
.append(makeDataEntry(link.parse(url, name), "name")).append(',')
|
|
||||||
.append(makeDataEntry(activityIndex.getValue(), activityString, "index")).append(',')
|
.append(makeDataEntry(activityIndex.getValue(), activityString, "index")).append(',')
|
||||||
.append(makeDataEntry(playtime, numberFormatters.get(FormatType.TIME_MILLISECONDS).apply(playtime), "playtime")).append(',')
|
.append(makeDataEntry(playtime, numberFormatters.get(FormatType.TIME_MILLISECONDS).apply(playtime), "playtime")).append(',')
|
||||||
.append(makeDataEntry(loginTimes, "sessions")).append(',')
|
.append(makeDataEntry(loginTimes, "sessions")).append(',')
|
||||||
.append(makeDataEntry(registered, numberFormatters.get(FormatType.DATE_YEAR).apply(registered), "registered")).append(',')
|
.append(makeDataEntry(registered, numberFormatters.get(FormatType.DATE_YEAR).apply(registered), "registered")).append(',')
|
||||||
.append(makeDataEntry(lastSeen, numberFormatters.get(FormatType.DATE_YEAR).apply(lastSeen), "seen")).append(',')
|
.append(makeDataEntry(lastSeen, numberFormatters.get(FormatType.DATE_YEAR).apply(lastSeen), "seen")).append(',')
|
||||||
.append(makeDataEntry(geolocation, "geolocation"))
|
.append(makeDataEntry(geolocation, "geolocation"));
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String makeDataEntry(Object data, String dataName) {
|
private String makeDataEntry(Object data, String dataName) {
|
||||||
|
Loading…
Reference in New Issue
Block a user