diff --git a/src/Components/Modules/ServerList.cpp b/src/Components/Modules/ServerList.cpp index aa673a95..afc64295 100644 --- a/src/Components/Modules/ServerList.cpp +++ b/src/Components/Modules/ServerList.cpp @@ -623,17 +623,10 @@ namespace Components std::hash hashFn; server.hash = hashFn(server); -#if false // more secure server.hostname = TextRenderer::StripMaterialTextIcons(server.hostname); -#else - // more fun ! - constexpr auto MAX_SERVER_NAME_LENGTH = 48; - server.hostname = server.hostname.substr(0, MAX_SERVER_NAME_LENGTH); - -#endif - const auto strippedHostName = TextRenderer::StripMaterialTextIcons(server.hostname); - if (server.hostname.empty() || strippedHostName.empty() || std::all_of(strippedHostName.begin(), strippedHostName.end(), isspace)) + + if (server.hostname.empty() || std::all_of(server.hostname.begin(), server.hostname.end(), isspace)) { // Invalid server name containing only emojis return; diff --git a/src/Components/Modules/TextRenderer.cpp b/src/Components/Modules/TextRenderer.cpp index 91d9ff52..8eb0fe05 100644 --- a/src/Components/Modules/TextRenderer.cpp +++ b/src/Components/Modules/TextRenderer.cpp @@ -1414,7 +1414,7 @@ namespace Components std::string TextRenderer::StripMaterialTextIcons(const std::string& in) { char buffer[1000]{}; // Should be more than enough - StripAllTextIcons(in.data(), buffer, sizeof(buffer)); + StripMaterialTextIcons(in.data(), buffer, sizeof(buffer)); return std::string{ buffer }; }