X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit-ng%2Fserver%2Fhtml2html.c;h=5a76bc2fc3ca1de59a175802f7b1c7d4af79888c;hb=b688cac3d673bdc0188107c8ab602ee313a3b792;hp=506a70de7fe1b538b800f5b3b2270fe8ad9a8bf4;hpb=b41aa04a613aab95aa822238ed9671063f72a7b8;p=citadel.git diff --git a/webcit-ng/server/html2html.c b/webcit-ng/server/html2html.c index 506a70de7..5a76bc2fc 100644 --- a/webcit-ng/server/html2html.c +++ b/webcit-ng/server/html2html.c @@ -181,10 +181,11 @@ StrBuf *html2html(const char *supplied_charset, int treat_as_wiki, char *roomnam // Any of these tags cause everything up to and including // the tag to be removed. - if ((!strncasecmp(ptr, "HTML", 4)) - || (!strncasecmp(ptr, "HEAD", 4)) - || (!strncasecmp(ptr, "/HEAD", 5)) - || (!strncasecmp(ptr, "BODY", 4))) { + if ( (!strncasecmp(ptr, "HTML", 4)) + || (!strncasecmp(ptr, "HEAD", 4)) + || (!strncasecmp(ptr, "/HEAD", 5)) + || (!strncasecmp(ptr, "BODY", 4)) + ) { char *pBody = NULL; if (!strncasecmp(ptr, "BODY", 4)) { @@ -252,10 +253,10 @@ StrBuf *html2html(const char *supplied_charset, int treat_as_wiki, char *roomnam converted_msg = NewStrBufPlain(NULL, content_length + 8192); // Convert foreign character sets to UTF-8 if necessary - if ((strcasecmp(charset, "us-ascii")) - && (strcasecmp(charset, "UTF-8")) - && (strcasecmp(charset, "")) - ) { + if ( (strcasecmp(charset, "us-ascii")) + && (strcasecmp(charset, "UTF-8")) + && (strcasecmp(charset, "")) + ) { syslog(LOG_DEBUG, "Converting %s to UTF-8", charset); ctdl_iconv_open("UTF-8", charset, &ic); if (ic == (iconv_t) (-1)) { @@ -341,10 +342,10 @@ StrBuf *html2html(const char *supplied_charset, int treat_as_wiki, char *roomnam ptr = &ptr[8]; } else if ((treat_as_wiki) - && (strncasecmp(ptr, "') + || (ptr[i] == '[') + || (ptr[i] == ']') + || (ptr[i] == '"') + || (ptr[i] == '\'') + ) { linklen = i; + } // entity tag? if (ptr[i] == '&') { if ((ptr[i + 2] == ';') ||