diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index d382faba55..532f3604c7 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -385,7 +385,9 @@ void RlvUtil::filterNames(std::string& strUTF8Text, bool fFilterLegacy) if (LLAvatarNameCache::get(idAgents[idxAgent], &avName)) { const std::string& strDisplayName = avName.getDisplayName(); + bool fFilterDisplay = (strDisplayName.length() > 2); const std::string& strLegacyName = avName.getLegacyName(); + fFilterLegacy &= (strLegacyName.length() > 2); const std::string& strAnonym = RlvStrings::getAnonym(avName); // If the display name is a subset of the legacy name we need to filter that first, otherwise it's the other way around @@ -393,11 +395,13 @@ void RlvUtil::filterNames(std::string& strUTF8Text, bool fFilterLegacy) { if (fFilterLegacy) boost::ireplace_all(strUTF8Text, strLegacyName, strAnonym); - boost::ireplace_all(strUTF8Text, strDisplayName, strAnonym); + if (fFilterDisplay) + boost::ireplace_all(strUTF8Text, strDisplayName, strAnonym); } else { - boost::ireplace_all(strUTF8Text, strDisplayName, strAnonym); + if (fFilterDisplay) + boost::ireplace_all(strUTF8Text, strDisplayName, strAnonym); if (fFilterLegacy) boost::ireplace_all(strUTF8Text, strLegacyName, strAnonym); }