diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index f5e3b8427..74f0ef8aa 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -39,23 +39,13 @@ static ISupport::EventProvider* isevprov; namespace Stats { - struct Entities final - { - static const insp::flat_map& entities; + static const insp::flat_map& xmlentities = { + { '<', "lt" }, + { '>', "gt" }, + { '&', "amp" }, + { '"', "quot" }, }; - static const insp::flat_map& init_entities() - { - static insp::flat_map entities; - entities['<'] = "lt"; - entities['>'] = "gt"; - entities['&'] = "amp"; - entities['"'] = "quot"; - return entities; - } - - const insp::flat_map& Entities::entities = init_entities(); - std::string Sanitize(const std::string& str) { std::string ret; @@ -63,8 +53,8 @@ namespace Stats for (const auto& chr : str) { - insp::flat_map::const_iterator it = Entities::entities.find(chr); - if (it != Entities::entities.end()) + insp::flat_map::const_iterator it = xmlentities.find(chr); + if (it != xmlentities.end()) { ret += '&'; ret += it->second;