summaryrefslogtreecommitdiffstats
path: root/src/libserver/html
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-07-29 10:32:58 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-07-29 10:33:31 +0100
commit7d3e0fc85e29b504e2fcfa83140708d7fea80eca (patch)
tree8b119286e566bb5611ae70b15782cb69b9a5887e /src/libserver/html
parentb3e427079527a5bf958e1d3de52c686a7accc33b (diff)
downloadrspamd-7d3e0fc85e29b504e2fcfa83140708d7fea80eca.tar.gz
rspamd-7d3e0fc85e29b504e2fcfa83140708d7fea80eca.zip
[Minor] Some fixes in content extraction for html tags
Diffstat (limited to 'src/libserver/html')
-rw-r--r--src/libserver/html/html_tag.hxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libserver/html/html_tag.hxx b/src/libserver/html/html_tag.hxx
index d7e80f41b..5cd22d777 100644
--- a/src/libserver/html/html_tag.hxx
+++ b/src/libserver/html/html_tag.hxx
@@ -126,6 +126,17 @@ struct html_tag {
children.clear();
closing.clear();
}
+
+ constexpr auto get_content_length() const -> std::size_t {
+ if (flags & (FL_IGNORE|CM_HEAD)) {
+ return 0;
+ }
+ if (closing.start > content_offset) {
+ return closing.start - content_offset;
+ }
+
+ return 0;
+ }
};
static_assert(CM_USER_SHIFT + 7 < sizeof(html_tag::flags) * NBBY);