From 72e057d533d7de87366cccb13c2721a0c41ff39c Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Thu, 28 Jun 2018 09:34:47 +1100 Subject: [PATCH] MP Create Game: escape any formatting applied to game name This is a good point since it ensures any place that might use the title before the lobby (don't think there's any such places right now) won't inadvertently get formatted. Also might be worth looking into a way to just strip formatting completely. --- src/gui/dialogs/multiplayer/mp_create_game.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/dialogs/multiplayer/mp_create_game.cpp b/src/gui/dialogs/multiplayer/mp_create_game.cpp index 455d48bbeabf..07356c9f087a 100644 --- a/src/gui/dialogs/multiplayer/mp_create_game.cpp +++ b/src/gui/dialogs/multiplayer/mp_create_game.cpp @@ -33,6 +33,7 @@ #else #include "gui/widgets/listbox.hpp" #endif +#include "font/pango/escape.hpp" #include "formatter.hpp" #include "formula/string_utils.hpp" #include "game_config.hpp" @@ -948,7 +949,7 @@ void mp_create_game::post_show(window& window) config_engine_->set_options(options_manager_->get_options_config()); // Set game name - const std::string name = find_widget(&window, "game_name", false).get_value(); + const std::string name = font::escape_text(find_widget(&window, "game_name", false).get_value()); if(!name.empty() && (name != ng::configure_engine::game_name_default())) { config_engine_->set_game_name(name); }