Skip to content

Commit

Permalink
Strip newlines from player-set game names
Browse files Browse the repository at this point in the history
Again, no idea how this could possibly happen, but I did see it.
  • Loading branch information
Vultraz committed Oct 26, 2020
1 parent 16d88b0 commit 6169ba9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/game_initialization/lobby_data.cpp
Expand Up @@ -401,7 +401,11 @@ game_info::game_info(const config& game, const std::vector<std::string>& install
verified = false;
}

// Remove any newlines that might have been in game titles
// Remove any newlines that might have been in game names (the player-set ones)
// No idea how this could happen, but I've seen it (vultraz, 2020-10-26)
boost::erase_all(name, "\n");

// Remove any newlines that might have been in game titles (scenario/campaign name, etc.)
boost::replace_all(scenario, "\n", " " + font::unicode_em_dash + " ");

if(reloaded) {
Expand Down

0 comments on commit 6169ba9

Please sign in to comment.