Skip to content

Commit

Permalink
HtmlFilter: fix an off-by-one error in minimized attrs processing
Browse files Browse the repository at this point in the history
...leading to HTML corruption which the filter itself occasionally trips
over.
  • Loading branch information
KitsuneRal committed Nov 20, 2024
1 parent 54fc44d commit 12a0ec5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/htmlfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ static const auto mxBgColorAttr = u"data-mx-bg-color";
&& m.capturedEnd(1) < gtPos) {
pos = m.capturedEnd();
if (m.captured(2).isEmpty()) {
static const auto attrValue = QString("=''");
static const auto attrValue = u"=''"_s;
html.insert(m.capturedEnd(1), attrValue);
gtPos += attrValue.size() - 1;
pos += attrValue.size() - 1;
gtPos += attrValue.size();
pos += attrValue.size();
}
}
// Make sure empty elements are properly closed
Expand Down

0 comments on commit 12a0ec5

Please sign in to comment.