diff --git a/src/gui/LeaderboardsGui.hx b/src/gui/LeaderboardsGui.hx
index d9ecd773..d5af1953 100644
--- a/src/gui/LeaderboardsGui.hx
+++ b/src/gui/LeaderboardsGui.hx
@@ -200,7 +200,7 @@ class LeaderboardsGui extends GuiImage {
for (score in scoreList) {
var scoreText = '${i}.
- ${score.name}
+ ${StringTools.htmlEscape(score.name)}
${score.rewind > 0 ? "
" : ""}
${isHuntScore ? Std.string(1000 - score.score) : Util.formatTime(score.score)}
${score.rating}
@@ -208,7 +208,7 @@ class LeaderboardsGui extends GuiImage {
if (levelSelectDifficulty == "customs") {
scoreText = '${i}.
- ${score.name}
+ ${StringTools.htmlEscape(score.name)}
${score.rewind > 0 ? "
" : ""}
${isHuntScore ? Std.string(1000 - score.score) : Util.formatTime(score.score)}
';
@@ -237,7 +237,7 @@ class LeaderboardsGui extends GuiImage {
for (score in scoreList) {
var scoreText = '${i}.
- ${score.name}
+ ${StringTools.htmlEscape(score.name)}
${score.rating}';
scoreTexts.push(scoreText);
i++;
diff --git a/src/gui/MPServerListGui.hx b/src/gui/MPServerListGui.hx
index 492a3ede..3b70bd1c 100644
--- a/src/gui/MPServerListGui.hx
+++ b/src/gui/MPServerListGui.hx
@@ -102,7 +102,7 @@ class MPServerListGui extends GuiImage {
function updateServerListDisplay() {
serverDisplays = ourServerList.map(x -> return
- '
${x.players}/${x.maxPlayers} ${x.name}');
+ '
${x.players}/${x.maxPlayers} ${StringTools.htmlEscape(x.name)}');
serverList.setTexts(serverDisplays);
}
diff --git a/src/gui/MultiplayerLevelSelectGui.hx b/src/gui/MultiplayerLevelSelectGui.hx
index 42f35b33..84378e5a 100644
--- a/src/gui/MultiplayerLevelSelectGui.hx
+++ b/src/gui/MultiplayerLevelSelectGui.hx
@@ -217,7 +217,8 @@ class MultiplayerLevelSelectGui extends GuiImage {
innerCtrl.addChild(chatWnd);
playerList = new GuiMLTextListCtrl(arial14, playerListArr.map(player -> {
- return '
${player.name}';
+ return
+ '
${StringTools.htmlEscape(player.name)}';
}), imgLoader);
playerList.selectedColor = 0xF29515;
playerList.selectedFillColor = 0xEBEBEB;
@@ -509,7 +510,8 @@ class MultiplayerLevelSelectGui extends GuiImage {
if (!showingCustoms)
playerList.setTexts(playerListArr.map(player -> {
- return '
${player.name}';
+ return
+ '
${StringTools.htmlEscape(player.name)}';
}));
var pubCount = 1; // Self
diff --git a/src/gui/PlayGui.hx b/src/gui/PlayGui.hx
index c954d375..ce86f9ec 100644
--- a/src/gui/PlayGui.hx
+++ b/src/gui/PlayGui.hx
@@ -789,9 +789,9 @@ class PlayGui {
var plShadowScores = [];
playerList.sort((a, b) -> a.score > b.score ? -1 : (a.score < b.score ? 1 : 0));
for (item in playerList) {
- pl.push('
${Util.rightPad(item.name, 25, 3)}');
+ pl.push('
${Util.rightPad(StringTools.htmlEscape(item.name), 25, 3)}');
plScores.push('${item.score}');
- plShadow.push('
${Util.rightPad(item.name, 25, 3)}');
+ plShadow.push('
${Util.rightPad(StringTools.htmlEscape(item.name), 25, 3)}');
plShadowScores.push('${item.score}');
}
playerListCtrl.setTexts(pl);
@@ -807,9 +807,9 @@ class PlayGui {
if (p2 == null) {
var onePt = p1.score == 1;
if (onePt)
- MarbleGame.instance.world.displayAlert('${p1.name} won with 1 point!');
+ MarbleGame.instance.world.displayAlert('${StringTools.htmlEscape(p1.name)} won with 1 point!');
else
- MarbleGame.instance.world.displayAlert('${p1.name} won with ${p1.score} points!');
+ MarbleGame.instance.world.displayAlert('${StringTools.htmlEscape(p1.name)} won with ${p1.score} points!');
} else {
var tie = p1.score == p2.score;
if (tie) {
@@ -817,9 +817,9 @@ class PlayGui {
} else {
var onePt = p1.score == 1;
if (onePt)
- MarbleGame.instance.world.displayAlert('${p1.name} won with 1 point!');
+ MarbleGame.instance.world.displayAlert('${StringTools.htmlEscape(p1.name)} won with 1 point!');
else
- MarbleGame.instance.world.displayAlert('${p1.name} won with ${p1.score} points!');
+ MarbleGame.instance.world.displayAlert('${StringTools.htmlEscape(p1.name)} won with ${p1.score} points!');
if (p1.id == Net.clientId) { // This us
AchievementsGui.queueMPAchievement(512);