~rjarry/aerc

136a28ff46dd321c98afa8a9d62c5f12a41f09b2 — Robin Jarry 4 months ago f99bcc4
colorize: allow pipe '|' as uri character

Some HTML emails contain weird URLs that contain unescaped pipes '|'.
For example:

https://foo.baz.fr/?data=05|02|foo@bar.fr|1|0|Unknown|=|0|||&reserved=0

Sadly, this does not seem standard but there's probably not much we can
do about it. Let's adapt colorize to also consider '|' as a valid URI
character.

Reported-by: Bence Ferdinandy <bence@ferdinandy.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>
1 files changed, 1 insertions(+), 1 deletions(-)

M filters/colorize.c
M filters/colorize.c => filters/colorize.c +1 -1
@@ 458,7 458,7 @@ static inline bool isurichar(char c)
		return false;
	if (isalnum(c))
		return true;
	if (strchr("-_.,~:;/?#@!$&%*+=\"'<>()[]", c) != NULL)
	if (strchr("-_.,~:;/?#@!$&%*+=\"'|<>()[]", c) != NULL)
		return true;
	return false;
}