mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-06 16:37:58 +01:00
Escaped escape characters for /v1/players
This commit is contained in:
parent
b5bed1e77e
commit
00de6e535e
@ -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.lang3.StringUtils;
|
||||||
import org.apache.commons.text.StringEscapeUtils;
|
import org.apache.commons.text.StringEscapeUtils;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -142,7 +143,7 @@ public class PlayersTableJSONParser {
|
|||||||
|
|
||||||
Html link = openPlayerPageInNewTab ? Html.LINK_EXTERNAL : Html.LINK;
|
Html link = openPlayerPageInNewTab ? Html.LINK_EXTERNAL : Html.LINK;
|
||||||
|
|
||||||
dataJSON.append(makeDataEntry(link.parse(url, StringEscapeUtils.escapeHtml4(name)), "name")).append(',') // Backslashes escaped to prevent json errors
|
dataJSON.append(makeDataEntry(link.parse(url, StringUtils.replace(StringEscapeUtils.escapeHtml4(name), "\\", "\\\\")), "name")).append(',') // Backslashes escaped to prevent json errors
|
||||||
.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(',')
|
||||||
|
Loading…
Reference in New Issue
Block a user