瀏覽代碼

In sanitize(), also accept attribute values between single quotes.

default 1 月之前
父節點
當前提交
5c27885a2f
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      format.c

+ 1 - 1
format.c

@@ -458,7 +458,7 @@ xs_str *sanitize(const char *content)
 
             if (valid_tags[i]) {
                 /* accepted tag: rebuild it with only the accepted elements */
-                xs *el = xs_regex_select(v, "(src|href|rel|class|target)=\"[^\"]*\"");
+                xs *el = xs_regex_select(v, "(src|href|rel|class|target)=(\"[^\"]*\"|'[^']*')");
                 xs *s3 = xs_join(el, " ");
 
                 s2 = xs_fmt("<%s%s%s%s>",