From 0d0033ea430ac2a9c9fc2c4c894ad197a6835dd3 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Thu, 22 Apr 2021 22:22:38 -0400 Subject: Don't URL-encode fragment links Seems that actually makes them not work correctly when they contain weird things. --- html.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/html.c b/html.c index 5104667..981dc4c 100644 --- a/html.c +++ b/html.c @@ -91,14 +91,6 @@ htmlAddressList(FILE *file, const char *name, struct AddressList list) { return templateRender(file, Q(), NULL, NULL); } -static char *htmlFragment(const char *messageID) { - struct Variable vars[] = { - { "messageID", messageID }, - {0}, - }; - return templateString("#[messageID]", vars, escapeURL); -} - static char *htmlMbox(const char *messageID) { struct Variable vars[] = { { "messageID", messageID }, @@ -155,40 +147,35 @@ static char *htmlReply(const struct Envelope *envelope) { } int htmlMessageNav(FILE *file, const struct Envelope *envelope) { - char *parent = envelope->inReplyTo - ? htmlFragment(envelope->inReplyTo) - : NULL; char *mbox = htmlMbox(envelope->messageID); char *reply = htmlReply(envelope); const char *template = Q( ); struct Variable vars[] = { - { "parent", parent }, + { "parent", envelope->inReplyTo }, { "mbox", mbox }, { "reply", reply }, {0}, }; int error = templateRender(file, template, vars, escapeXML); - free(parent); free(mbox); free(reply); return error; } int htmlMessageOpen(FILE *file, const struct Envelope *envelope, bool nested) { - char *fragment = htmlFragment(envelope->messageID); char *mailto = htmlMailto(envelope->from); const char *template = Q(
-

[subject]

+

[subject]

From: [from] @@ -196,7 +183,6 @@ int htmlMessageOpen(FILE *file, const struct Envelope *envelope, bool nested) { ); struct Variable vars[] = { { "messageID", envelope->messageID }, - { "fragment", fragment }, { "subject", envelope->subject }, { "mailto", mailto }, { "from", addressName(envelope->from) }, @@ -210,7 +196,6 @@ int htmlMessageOpen(FILE *file, const struct Envelope *envelope, bool nested) { || htmlAddressList(file, "Cc", envelope->cc) || (nested ? 0 : htmlMessageNav(file, envelope)) || templateRender(file, Q(
), NULL, NULL); - free(fragment); free(mailto); return error; } -- cgit 1.4.1