Skip to content

Commit

Permalink
MP Create Game: escape any formatting applied to game name
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Vultraz committed Jun 27, 2018
1 parent 690a9de commit 72e057d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gui/dialogs/multiplayer/mp_create_game.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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<text_box>(&window, "game_name", false).get_value();
const std::string name = font::escape_text(find_widget<text_box>(&window, "game_name", false).get_value());
if(!name.empty() && (name != ng::configure_engine::game_name_default())) {
config_engine_->set_game_name(name);
}
Expand Down

0 comments on commit 72e057d

Please sign in to comment.