mirror of
https://github.com/SWG-Source/src.git
synced 2026-07-14 23:07:48 -04:00
Fixed issue with profanity filter
This commit is contained in:
@@ -120,7 +120,7 @@ void TextManagerNamespace::getAppropriateWord(Unicode::String &text)
|
||||
// Sub-string search time for words that are listed for sub-string searches
|
||||
|
||||
Unicode::String lowerText(Unicode::toLower(text));
|
||||
unsigned int findStartPosition = 0;
|
||||
size_t findStartPosition = 0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -137,7 +137,7 @@ void TextManagerNamespace::getAppropriateWord(Unicode::String &text)
|
||||
continue;
|
||||
}
|
||||
|
||||
unsigned int index = lowerText.find(cussWord, findStartPosition);
|
||||
size_t index = lowerText.find(cussWord, findStartPosition);
|
||||
|
||||
if (index != Unicode::String::npos)
|
||||
{
|
||||
@@ -297,8 +297,8 @@ Unicode::String TextManager::filterText(Unicode::String const &text)
|
||||
{
|
||||
Unicode::String result(text);
|
||||
Unicode::String::const_iterator iterText = text.begin();
|
||||
int startIndex = Unicode::String::npos;
|
||||
int currentIndex = 0;
|
||||
size_t startIndex = Unicode::String::npos;
|
||||
size_t currentIndex = 0;
|
||||
|
||||
{
|
||||
// Walk through the text finding sections of alpha characters.
|
||||
@@ -309,12 +309,12 @@ Unicode::String TextManager::filterText(Unicode::String const &text)
|
||||
{
|
||||
Unicode::unicode_char_t const character = (*iterText);
|
||||
|
||||
if ( (static_cast<unsigned>(startIndex) == Unicode::String::npos)
|
||||
if ( (startIndex == Unicode::String::npos)
|
||||
&& isAlpha(character))
|
||||
{
|
||||
startIndex = currentIndex;
|
||||
}
|
||||
else if ( (static_cast<unsigned>(startIndex) != Unicode::String::npos)
|
||||
else if ( (startIndex != Unicode::String::npos)
|
||||
&& !isAlpha(character))
|
||||
{
|
||||
checkText(result, startIndex, currentIndex);
|
||||
@@ -327,7 +327,7 @@ Unicode::String TextManager::filterText(Unicode::String const &text)
|
||||
|
||||
// Possibly check the last word
|
||||
|
||||
if (static_cast<unsigned>(startIndex) != Unicode::String::npos)
|
||||
if (startIndex != Unicode::String::npos)
|
||||
{
|
||||
checkText(result, startIndex, currentIndex);
|
||||
}
|
||||
@@ -346,12 +346,12 @@ Unicode::String TextManager::filterText(Unicode::String const &text)
|
||||
{
|
||||
Unicode::unicode_char_t const character = (*iterText);
|
||||
|
||||
if ( (static_cast<unsigned>(startIndex) == Unicode::String::npos)
|
||||
if ( (startIndex == Unicode::String::npos)
|
||||
&& character != static_cast<Unicode::unicode_char_t>(' '))
|
||||
{
|
||||
startIndex = currentIndex;
|
||||
}
|
||||
else if ( (static_cast<unsigned>(startIndex) != Unicode::String::npos)
|
||||
else if ( (startIndex != Unicode::String::npos)
|
||||
&& character == static_cast<Unicode::unicode_char_t>(' '))
|
||||
{
|
||||
checkText(result, startIndex, currentIndex);
|
||||
@@ -364,7 +364,7 @@ Unicode::String TextManager::filterText(Unicode::String const &text)
|
||||
|
||||
// Possibly check the last word
|
||||
|
||||
if (static_cast<unsigned>(startIndex) != Unicode::String::npos)
|
||||
if (startIndex != Unicode::String::npos)
|
||||
{
|
||||
checkText(result, startIndex, currentIndex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user