Fossil SCM

After attaching a file to a forum post, redirect back to that post instead of /attachview.

stephan 2026-05-24 17:30 UTC forum-attachments
Commit ce5b3b5d388f9e5ef1c264f4256f7d76e4042c01ecdbdae8d5caba9828746ef2
1 file changed +4 -2
+4 -2
--- src/attach.c
+++ src/attach.c
@@ -444,12 +444,14 @@
444444
"forum posts.");
445445
}
446446
zTarget = zExtraFree = rid_to_uuid(fpid);
447447
zTargetType = mprintf("Forum post <a href=\"%R/forumpost/%S\">%h</a>",
448448
zTarget, zForumPost);
449
- zTo = mprintf("%R/attachview?forumpost=%T&file=%T",
450
- zTarget, zName)
449
+ zTo = 1
450
+ ? mprintf("%R/forumpost/%S", zTarget)
451
+ : mprintf("%R/attachview?forumpost=%T&file=%T",
452
+ zTarget, zName)
451453
/* Or we could return directly to the forum post. */;
452454
}else if( zPage ){
453455
if( g.perm.ApndWiki==0 || g.perm.Attach==0 ){
454456
login_needed(g.anon.ApndWiki && g.anon.Attach);
455457
return;
456458
--- src/attach.c
+++ src/attach.c
@@ -444,12 +444,14 @@
444 "forum posts.");
445 }
446 zTarget = zExtraFree = rid_to_uuid(fpid);
447 zTargetType = mprintf("Forum post <a href=\"%R/forumpost/%S\">%h</a>",
448 zTarget, zForumPost);
449 zTo = mprintf("%R/attachview?forumpost=%T&file=%T",
450 zTarget, zName)
 
 
451 /* Or we could return directly to the forum post. */;
452 }else if( zPage ){
453 if( g.perm.ApndWiki==0 || g.perm.Attach==0 ){
454 login_needed(g.anon.ApndWiki && g.anon.Attach);
455 return;
456
--- src/attach.c
+++ src/attach.c
@@ -444,12 +444,14 @@
444 "forum posts.");
445 }
446 zTarget = zExtraFree = rid_to_uuid(fpid);
447 zTargetType = mprintf("Forum post <a href=\"%R/forumpost/%S\">%h</a>",
448 zTarget, zForumPost);
449 zTo = 1
450 ? mprintf("%R/forumpost/%S", zTarget)
451 : mprintf("%R/attachview?forumpost=%T&file=%T",
452 zTarget, zName)
453 /* Or we could return directly to the forum post. */;
454 }else if( zPage ){
455 if( g.perm.ApndWiki==0 || g.perm.Attach==0 ){
456 login_needed(g.anon.ApndWiki && g.anon.Attach);
457 return;
458

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button