summaryrefslogtreecommitdiff
path: root/plugins/NewStory
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-10-18 14:33:27 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-10-18 14:33:27 +0300
commitdf0cfdfc8969d38e509ad57a18659d209b3f0ddd (patch)
tree966fcd3092fbf746748c35124f79722b4e4095d5 /plugins/NewStory
parent37bdacf42b9d3942215bbd72f8ce32377e2f2d71 (diff)
NewStory: fix for the eternal loop in RemoveBbcodes()
Diffstat (limited to 'plugins/NewStory')
-rw-r--r--plugins/NewStory/src/utils.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/NewStory/src/utils.cpp b/plugins/NewStory/src/utils.cpp
index e5fce8ffc6..7bef6e83a6 100644
--- a/plugins/NewStory/src/utils.cpp
+++ b/plugins/NewStory/src/utils.cpp
@@ -78,6 +78,7 @@ void RemoveBbcodes(CMStringW &wszText)
}
for (int idx = wszText.Find('[', 0); idx != -1; idx = wszText.Find('[', idx)) {
+ bool bFound = false;
for (auto &it : bbcodes) {
if (wcsncmp(wszText.c_str() + idx, it.pStart, it.cbStart))
continue;
@@ -92,7 +93,12 @@ void RemoveBbcodes(CMStringW &wszText)
}
}
+ bFound = true;
break;
}
+
+ // just an occasional square bracket? skip it
+ if (!bFound)
+ idx++;
}
}