diff options
| author | AL <26797547+Al12rs@users.noreply.github.com> | 2020-02-22 14:48:59 +0100 |
|---|---|---|
| committer | AL <26797547+Al12rs@users.noreply.github.com> | 2020-02-22 14:48:59 +0100 |
| commit | e5688ecea38d7a4247d0cd50d7ce290f1d810c2b (patch) | |
| tree | 750d1b54188e71bb93f43ac04117a62929d7cd1b /src | |
| parent | 6107883829cd55adad7f58121c54af8af6ad4280 (diff) | |
Fix crashing on Nexus descriptions that are missing BBCode closing brackets.
Diffstat (limited to 'src')
| -rw-r--r-- | src/bbcode.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bbcode.cpp b/src/bbcode.cpp index d9b7debd..e56c4ea2 100644 --- a/src/bbcode.cpp +++ b/src/bbcode.cpp @@ -246,7 +246,14 @@ QString convertToHTML(const QString &inputParam) if ((pos < (input.size() - 1)) && (input.at(pos + 1) == '/')) {
// skip invalid end tag
int tagEnd = input.indexOf(']', pos) + 1;
- pos = tagEnd;
+ if (tagEnd == 0) {
+ //no closing tag found
+ //move the pos up one so that the opening bracket is ignored next iteration
+ pos++;
+ }
+ else {
+ pos = tagEnd;
+ }
} else {
// convert the tag and content if necessary
int length = -1;
|
