mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 10:39:02 -04:00
Fix a regression in ProcessColors.
We should wait until v5 to be this aggressive with MOTD parsing so we dont break existing users in a minor release.
This commit is contained in:
parent
f6da60b3f4
commit
faa96b7956
@ -194,20 +194,12 @@ void InspIRCd::ProcessColors(std::string& line)
|
||||
|
||||
auto start = idx;
|
||||
if (++idx >= line.length())
|
||||
{
|
||||
// Stray \ at the end of the string; strip.
|
||||
line.pop_back();
|
||||
continue;
|
||||
}
|
||||
continue; // Stray \ at the end of the string; skip.
|
||||
|
||||
const auto chr = line[idx];
|
||||
const auto it = formats.find(chr);
|
||||
if (it == formats.end())
|
||||
{
|
||||
// Unknown escape, strip.
|
||||
line.erase(start, 2);
|
||||
continue;
|
||||
}
|
||||
continue; // Unknown escape, skip.
|
||||
|
||||
line.replace(start, 2, it->second);
|
||||
idx = start + it->second.length();
|
||||
|
Loading…
x
Reference in New Issue
Block a user