Fix runIgnoreReplaces fall into infinity loop (#2151)
* Fix `runIgnoreReplaces` fall into infinity loop The regex pattern was not checked for emptiness, which led to an endless loop * Update CHANGELOG.md Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -44,6 +44,7 @@
|
|||||||
- Bugfix: Fix Tab key not working in the Ctrl+K Quick Switcher (#2065)
|
- Bugfix: Fix Tab key not working in the Ctrl+K Quick Switcher (#2065)
|
||||||
- Bugfix: Fix bug preventing moderator actions when viewing a user card from the search window (#1089)
|
- Bugfix: Fix bug preventing moderator actions when viewing a user card from the search window (#1089)
|
||||||
- Bugfix: Fix `:` emote completion menu ignoring emote capitalization (#1962)
|
- Bugfix: Fix `:` emote completion menu ignoring emote capitalization (#1962)
|
||||||
|
- Bugfix: Fix a bug that caused `Ignore page` to fall into an infinity loop with an empty pattern and regex enabled (#2125)
|
||||||
|
|
||||||
## 2.2.0
|
## 2.2.0
|
||||||
|
|
||||||
|
|||||||
@@ -763,6 +763,11 @@ void TwitchMessageBuilder::runIgnoreReplaces(
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
const auto &pattern = phrase.getPattern();
|
||||||
|
if (pattern.isEmpty())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (phrase.isRegex())
|
if (phrase.isRegex())
|
||||||
{
|
{
|
||||||
const auto ®ex = phrase.getRegex();
|
const auto ®ex = phrase.getRegex();
|
||||||
@@ -835,11 +840,6 @@ void TwitchMessageBuilder::runIgnoreReplaces(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const auto &pattern = phrase.getPattern();
|
|
||||||
if (pattern.isEmpty())
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
int from = 0;
|
int from = 0;
|
||||||
while ((from = this->originalMessage_.indexOf(
|
while ((from = this->originalMessage_.indexOf(
|
||||||
pattern, from, phrase.caseSensitivity())) != -1)
|
pattern, from, phrase.caseSensitivity())) != -1)
|
||||||
|
|||||||
Reference in New Issue
Block a user