From a4be8eef0d611a84cc079abfc89841b0c9bcdfab Mon Sep 17 00:00:00 2001 From: SJ Date: Mon, 23 Jul 2012 16:20:01 +0200 Subject: [PATCH] commented out decodeURL(), and minor code clean up --- src/parser.c | 4 +++- src/parser_utils.c | 13 +------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/parser.c b/src/parser.c index 8ef39e38..0f56e3c2 100644 --- a/src/parser.c +++ b/src/parser.c @@ -419,6 +419,7 @@ int parse_line(char *buf, struct _state *state, struct session_data *sdata, int } + /* remove all HTML tags */ if(state->texthtml == 1 && state->message_state == MSG_BODY) markHTML(buf, state); if(state->message_state == MSG_BODY && state->qp == 1){ @@ -426,7 +427,8 @@ int parse_line(char *buf, struct _state *state, struct session_data *sdata, int decodeQP(buf); } - decodeURL(buf); + /* I believe that we can live without this function call */ + //decodeURL(buf); if(state->texthtml == 1) decodeHTML(buf); diff --git a/src/parser_utils.c b/src/parser_utils.c index bfe9b916..ce8548d0 100644 --- a/src/parser_utils.c +++ b/src/parser_utils.c @@ -306,9 +306,7 @@ void fixupSoftBreakInQuotedPritableLine(char *buf, struct _state *state){ if(p){ memset(state->qpbuf, 0, MAX_TOKEN_LEN); if(strlen(p) < MAX_TOKEN_LEN-1){ - //snprintf(state->qpbuf, MAX_TOKEN_LEN-1, "%s", p); memcpy(&(state->qpbuf[0]), p, MAX_TOKEN_LEN-1); - *p = '\0'; } @@ -334,9 +332,7 @@ void fixupBase64EncodedLine(char *buf, struct _state *state){ if(buf[strlen(buf)-1] != '\n'){ p = strrchr(buf, ' '); if(p){ - //strncpy(state->miscbuf, p+1, MAX_TOKEN_LEN-1); memcpy(&(state->miscbuf[0]), p+1, MAX_TOKEN_LEN-1); - *p = '\0'; } } @@ -478,17 +474,10 @@ void translateLine(unsigned char *p, struct _state *state){ if(strncasecmp((char *)p, "http://", 7) == 0){ p += 7; url = 1; continue; } if(strncasecmp((char *)p, "https://", 8) == 0){ p += 8; url = 1; continue; } - if(url == 1 && (*p == '.' || *p == '-' || *p == '_' || *p == '/' || isalnum(*p)) ) continue; + if(url == 1 && (*p == '.' || *p == '-' || *p == '_' || *p == '/' || *p == '%' || *p == '?' || isalnum(*p)) ) continue; if(url == 1) url = 0; } - if(state->texthtml == 1 && state->message_state == MSG_BODY && strncmp((char *)p, "HTML*", 5) == 0){ - p += 5; - while(isspace(*p) == 0){ - p++; - } - } - if(delimiter_characters[(unsigned int)*p] != ' ') *p = ' '; /* we MUSTN'T convert it to lowercase in the 'else' case, because it breaks utf-8 encoding! */