projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3d35459
)
* Abuse the MIME 'filename' key by using it as a memo field in which we store a base6...
author
Art Cancro
<ajc@citadel.org>
Tue, 20 Oct 2009 21:46:11 +0000
(21:46 +0000)
committer
Art Cancro
<ajc@citadel.org>
Tue, 20 Oct 2009 21:46:11 +0000
(21:46 +0000)
citadel/modules/wiki/serv_wiki.c
patch
|
blob
|
history
diff --git
a/citadel/modules/wiki/serv_wiki.c
b/citadel/modules/wiki/serv_wiki.c
index c41fb12d073cfb993c005939ea883dd329847e3c..9a8b7caab7b50a2506e0eeed8ac6ac676ecf5765 100644
(file)
--- a/
citadel/modules/wiki/serv_wiki.c
+++ b/
citadel/modules/wiki/serv_wiki.c
@@
-247,21
+247,29
@@
int wiki_upload_beforesave(struct CtdlMessage *msg) {
if (!IsEmptyStr(boundary)) {
snprintf(prefixed_boundary, sizeof prefixed_boundary, "--%s", boundary);
history_msg->cm_fields['M'] = realloc(history_msg->cm_fields['M'],
if (!IsEmptyStr(boundary)) {
snprintf(prefixed_boundary, sizeof prefixed_boundary, "--%s", boundary);
history_msg->cm_fields['M'] = realloc(history_msg->cm_fields['M'],
- strlen(history_msg->cm_fields['M']) + strlen(diffbuf) +
512
+ strlen(history_msg->cm_fields['M']) + strlen(diffbuf) +
1024
);
ptr = bmstrcasestr(history_msg->cm_fields['M'], prefixed_boundary);
if (ptr != NULL) {
char *the_rest_of_it = strdup(ptr);
);
ptr = bmstrcasestr(history_msg->cm_fields['M'], prefixed_boundary);
if (ptr != NULL) {
char *the_rest_of_it = strdup(ptr);
+ char memo[512];
+ char encoded_memo[768];
+ snprintf(memo, sizeof memo, "%s|%s|%ld",
+ CCC->user.fullname,
+ CCC->cs_inet_email,
+ time(NULL)
+ );
+ CtdlEncodeBase64(encoded_memo, memo, strlen(memo), 0);
sprintf(ptr, "--%s\n"
"Content-type: text/plain\n"
sprintf(ptr, "--%s\n"
"Content-type: text/plain\n"
- "From: %s <%s>\n"
+ "Content-Disposition: inline; filename=\"%s\"\n"
+ "Content-Transfer-Encoding: 8bit\n"
"\n"
"%s\n"
"%s"
,
boundary,
"\n"
"%s\n"
"%s"
,
boundary,
- CCC->user.fullname,
- CCC->cs_inet_email,
+ encoded_memo,
diffbuf,
the_rest_of_it
);
diffbuf,
the_rest_of_it
);