aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/html/html_entities.cxx
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-07-09 14:26:44 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-07-09 14:26:44 +0100
commit0bf8b20eea56bd939bc40f4c922c3eefbc52749c (patch)
tree37de555aa731b1aeaafad86003451c86a683492f /src/libserver/html/html_entities.cxx
parentca75670ee0f606734170f39d2cb1b63beb3780be (diff)
downloadrspamd-0bf8b20eea56bd939bc40f4c922c3eefbc52749c.tar.gz
rspamd-0bf8b20eea56bd939bc40f4c922c3eefbc52749c.zip
[Minor] Add helper to decode entities in an std::string
Diffstat (limited to 'src/libserver/html/html_entities.cxx')
-rw-r--r--src/libserver/html/html_entities.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libserver/html/html_entities.cxx b/src/libserver/html/html_entities.cxx
index 84e05953d..fa19463a0 100644
--- a/src/libserver/html/html_entities.cxx
+++ b/src/libserver/html/html_entities.cxx
@@ -2572,6 +2572,13 @@ decode_html_entitles_inplace(char *s, std::size_t len, bool norm_spaces)
return (t - s);
}
+auto
+decode_html_entitles_inplace(std::string &st) -> void
+{
+ auto nlen = decode_html_entitles_inplace(st.data(), st.size());
+ st.resize(nlen);
+}
+
TEST_SUITE("html") {
TEST_CASE("html entities") {