Commit f9315755 authored by Peter Bloomfield's avatar Peter Bloomfield
Browse files

mime: No trailing comma in a URL

The regex that Balsa uses to identify a URL in a plain text message part
already omits a trailing period ('.') from the match, as it is usually
punctuation and not part of the URL. This commit additionally removes a comma
(',') from the last character match, for the same reason: more likely to be
punctuation. This of course breaks the identification of a URL that *does* end
in a comma, but that appears to be less likely than erroneously including one.

Discussion at #59.
parent a0e88434
Pipeline #310109 passed with stage
in 35 seconds
......@@ -854,7 +854,9 @@ get_url_reg(void)
NULL,
"(((https?|ftps?|nntp)://)|(mailto:|news:))"
"(%[0-9A-F]{2}|[-_.!~*';/?:@&=+$,#[:alnum:]])+"
"(%[0-9A-F]{2}|[-_!~*';/?:@&=+$,#[:alnum:]])",
/* do not include a trailing period or comma as part of the match;
* it is more likely to be punctuation than part of a URL */
"(%[0-9A-F]{2}|[-_!~*';/?:@&=+$#[:alnum:]])",
__func__,
"url regex compilation failed"
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment