projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e855e5f
)
Ugly hack to fix wiki history broken by the 'message xxx is not in this room' securit...
author
Art Cancro
<ajc@uncensored.citadel.org>
Fri, 1 Jul 2011 05:13:12 +0000
(
01:13
-0400)
committer
Art Cancro
<ajc@uncensored.citadel.org>
Fri, 1 Jul 2011 05:16:43 +0000
(
01:16
-0400)
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 9596013153091a307a6e794b8822082ad2825d04..5db43b33fef068982cbf951c5d129ee5517cb4c6 100644
(file)
--- a/
citadel/modules/wiki/serv_wiki.c
+++ b/
citadel/modules/wiki/serv_wiki.c
@@
-583,6
+583,18
@@
void wiki_rev(char *pagename, char *rev, char *operation)
msg->cm_fields['A'] = strdup("Citadel");
CtdlCreateRoom(wwm, 5, "", 0, 1, 1, VIEW_BBS); /* Not an error if already exists */
msgnum = CtdlSubmitMsg(msg, NULL, wwm, 0); /* Store the revision here */
msg->cm_fields['A'] = strdup("Citadel");
CtdlCreateRoom(wwm, 5, "", 0, 1, 1, VIEW_BBS); /* Not an error if already exists */
msgnum = CtdlSubmitMsg(msg, NULL, wwm, 0); /* Store the revision here */
+
+ /*
+ * WARNING: VILE SLEAZY HACK
+ * This will avoid the 'message xxx is not in this room' security error,
+ * but only if the client fetches the message we just generated immediately
+ * without first trying to perform other fetch operations.
+ */
+ if (CC->cached_msglist != NULL) free(CC->cached_msglist);
+ CC->cached_num_msgs = 1;
+ CC->cached_msglist = malloc(sizeof(long));
+ CC->cached_msglist[0] = msgnum;
+
}
else if (!strcasecmp(operation, "revert")) {
snprintf(timestamp, sizeof timestamp, "%ld", time(NULL));
}
else if (!strcasecmp(operation, "revert")) {
snprintf(timestamp, sizeof timestamp, "%ld", time(NULL));