Explorar el Código

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

default hace 1 mes
padre
commit
5c27885a2f
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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>",