store = TRUE;
state = parse_end_dquote;
}
+
if (store) {
if (*savep != NULL) {
- gchar *s;
-
g_assert (tag->params != NULL);
comp = g_queue_peek_tail (tag->params);
g_assert (comp != NULL);
comp->len = in - *savep;
- s = rspamd_mempool_alloc (pool, comp->len);
- memcpy (s, *savep, comp->len);
- comp->len = rspamd_html_decode_entitles_inplace (s, comp->len);
- comp->start = s;
+ comp->start = *savep;
+ /* We cannot use entities inside tag values ! */
*savep = NULL;
}
}
}
if (store) {
if (*savep != NULL) {
- gchar *s;
-
g_assert (tag->params != NULL);
comp = g_queue_peek_tail (tag->params);
g_assert (comp != NULL);
comp->len = in - *savep;
- s = rspamd_mempool_alloc (pool, comp->len);
- memcpy (s, *savep, comp->len);
- comp->len = rspamd_html_decode_entitles_inplace (s, comp->len);
- comp->start = s;
+ comp->start = *savep;
*savep = NULL;
}
}
if (store) {
if (*savep != NULL) {
- gchar *s;
-
g_assert (tag->params != NULL);
comp = g_queue_peek_tail (tag->params);
g_assert (comp != NULL);
comp->len = in - *savep;
- s = rspamd_mempool_alloc (pool, comp->len);
- memcpy (s, *savep, comp->len);
- comp->len = rspamd_html_decode_entitles_inplace (s, comp->len);
- comp->start = s;
+ comp->start = *savep;
*savep = NULL;
}
}
}
}
- /* We also need to remove all internal newlines and encode unsafe characters */
+ /*
+ * We also need to remove all internal newlines, spaces
+ * and encode unsafe characters
+ */
for (i = 0; i < len; i ++) {
- if (G_UNLIKELY (s[i] == '\r' || s[i] == '\n')) {
+ if (G_UNLIKELY (g_ascii_isspace (s[i]))) {
continue;
}
else if (G_UNLIKELY (((guint)s[i]) < 0x80 && !g_ascii_isgraph (s[i]))) {