FIRE-29244: Chat keywords don't work properly if keyword list contains whitespaces for readability; based on a patch by Testicular Slingshot

master
Ansariel 2020-01-25 10:23:32 +01:00
parent 83a9e1d450
commit fe37eb66ef
1 changed files with 5 additions and 2 deletions

View File

@ -63,13 +63,16 @@ void FSKeywords::updateKeywords()
mWordList.clear();
while (begin != end)
{
std::string token(*begin++);
LLStringUtil::trim(token);
if (match_whole_words)
{
mWordList.push_back(boost::regex_replace(std::string(*begin++), boost::regex("[.^$|()\\[\\]{}*+?\\\\]"), "\\\\&", boost::match_default|boost::format_sed));
mWordList.push_back(boost::regex_replace(token, boost::regex("[.^$|()\\[\\]{}*+?\\\\]"), "\\\\&", boost::match_default|boost::format_sed));
}
else
{
mWordList.push_back(*begin++);
mWordList.push_back(token);
}
}
}