Fossil SCM
Correct /artifact/ATTACHMENT_ID to distinguish forum post attachments from wiki page attachments.
Commit
19506538a50fb334f970e2766dc37008a97ce262afd3b71740f5bcb2f04d1b12
Parent
55d9faf99e30d57…
2 files changed
+1
+7
-1
+1
| --- src/attach.c | ||
| +++ src/attach.c | ||
| @@ -26,10 +26,11 @@ | ||
| 26 | 26 | ** List attachments. |
| 27 | 27 | ** |
| 28 | 28 | ** tkt=HASH |
| 29 | 29 | ** page=WIKIPAGE |
| 30 | 30 | ** technote=HASH |
| 31 | +** forumpost=HASH | |
| 31 | 32 | ** |
| 32 | 33 | ** At most one of technote=, tkt= or page= may be supplied. |
| 33 | 34 | ** |
| 34 | 35 | ** If none are given, all attachments are listed. If one is given, only |
| 35 | 36 | ** attachments for the designated technote, ticket or wiki page are shown. |
| 36 | 37 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -26,10 +26,11 @@ | |
| 26 | ** List attachments. |
| 27 | ** |
| 28 | ** tkt=HASH |
| 29 | ** page=WIKIPAGE |
| 30 | ** technote=HASH |
| 31 | ** |
| 32 | ** At most one of technote=, tkt= or page= may be supplied. |
| 33 | ** |
| 34 | ** If none are given, all attachments are listed. If one is given, only |
| 35 | ** attachments for the designated technote, ticket or wiki page are shown. |
| 36 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -26,10 +26,11 @@ | |
| 26 | ** List attachments. |
| 27 | ** |
| 28 | ** tkt=HASH |
| 29 | ** page=WIKIPAGE |
| 30 | ** technote=HASH |
| 31 | ** forumpost=HASH |
| 32 | ** |
| 33 | ** At most one of technote=, tkt= or page= may be supplied. |
| 34 | ** |
| 35 | ** If none are given, all attachments are listed. If one is given, only |
| 36 | ** attachments for the designated technote, ticket or wiki page are shown. |
| 37 |
+7
-1
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -1872,11 +1872,17 @@ | ||
| 1872 | 1872 | }else{ |
| 1873 | 1873 | @ Attachment "%h(zFilename)" to |
| 1874 | 1874 | } |
| 1875 | 1875 | objType |= OBJTYPE_ATTACHMENT; |
| 1876 | 1876 | if( fossil_is_artifact_hash(zTarget) ){ |
| 1877 | - if ( db_exists("SELECT 1 FROM tag WHERE tagname='tkt-%q'", | |
| 1877 | + if( forumpost_head_rid2(zTarget)>0 ){ | |
| 1878 | + if( g.perm.Hyperlink && g.anon.RdForum ){ | |
| 1879 | + @ forum post [%z(href("%R/forumpost/%!S",zTarget))%S(zTarget)</a>] | |
| 1880 | + }else{ | |
| 1881 | + @ forum post [%S(zTarget)] | |
| 1882 | + } | |
| 1883 | + }else if ( db_exists("SELECT 1 FROM tag WHERE tagname='tkt-%q'", | |
| 1878 | 1884 | zTarget) |
| 1879 | 1885 | ){ |
| 1880 | 1886 | if( g.perm.Hyperlink && g.anon.RdTkt ){ |
| 1881 | 1887 | @ ticket [%z(href("%R/tktview?name=%!S",zTarget))%S(zTarget)</a>] |
| 1882 | 1888 | }else{ |
| 1883 | 1889 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1872,11 +1872,17 @@ | |
| 1872 | }else{ |
| 1873 | @ Attachment "%h(zFilename)" to |
| 1874 | } |
| 1875 | objType |= OBJTYPE_ATTACHMENT; |
| 1876 | if( fossil_is_artifact_hash(zTarget) ){ |
| 1877 | if ( db_exists("SELECT 1 FROM tag WHERE tagname='tkt-%q'", |
| 1878 | zTarget) |
| 1879 | ){ |
| 1880 | if( g.perm.Hyperlink && g.anon.RdTkt ){ |
| 1881 | @ ticket [%z(href("%R/tktview?name=%!S",zTarget))%S(zTarget)</a>] |
| 1882 | }else{ |
| 1883 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1872,11 +1872,17 @@ | |
| 1872 | }else{ |
| 1873 | @ Attachment "%h(zFilename)" to |
| 1874 | } |
| 1875 | objType |= OBJTYPE_ATTACHMENT; |
| 1876 | if( fossil_is_artifact_hash(zTarget) ){ |
| 1877 | if( forumpost_head_rid2(zTarget)>0 ){ |
| 1878 | if( g.perm.Hyperlink && g.anon.RdForum ){ |
| 1879 | @ forum post [%z(href("%R/forumpost/%!S",zTarget))%S(zTarget)</a>] |
| 1880 | }else{ |
| 1881 | @ forum post [%S(zTarget)] |
| 1882 | } |
| 1883 | }else if ( db_exists("SELECT 1 FROM tag WHERE tagname='tkt-%q'", |
| 1884 | zTarget) |
| 1885 | ){ |
| 1886 | if( g.perm.Hyperlink && g.anon.RdTkt ){ |
| 1887 | @ ticket [%z(href("%R/tktview?name=%!S",zTarget))%S(zTarget)</a>] |
| 1888 | }else{ |
| 1889 |