Fossil SCM
After attaching a file to a forum post, redirect back to that post instead of /attachview.
Commit
ce5b3b5d388f9e5ef1c264f4256f7d76e4042c01ecdbdae8d5caba9828746ef2
Parent
dfe39cc5c25c907…
1 file changed
+4
-2
+4
-2
| --- src/attach.c | ||
| +++ src/attach.c | ||
| @@ -444,12 +444,14 @@ | ||
| 444 | 444 | "forum posts."); |
| 445 | 445 | } |
| 446 | 446 | zTarget = zExtraFree = rid_to_uuid(fpid); |
| 447 | 447 | zTargetType = mprintf("Forum post <a href=\"%R/forumpost/%S\">%h</a>", |
| 448 | 448 | 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) | |
| 451 | 453 | /* Or we could return directly to the forum post. */; |
| 452 | 454 | }else if( zPage ){ |
| 453 | 455 | if( g.perm.ApndWiki==0 || g.perm.Attach==0 ){ |
| 454 | 456 | login_needed(g.anon.ApndWiki && g.anon.Attach); |
| 455 | 457 | return; |
| 456 | 458 |
| --- 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 |