Fossil SCM

Remove an unused feature from /forumpost_close. Fix a broken HTML tag. Remove some dead code. Correct some internal docs.

stephan 2026-05-28 19:12 UTC forum-statuses
Commit fe211fda591f6c12e8f6c62ee49da0ad8685ab43a09de6520a486010f30fcc62
2 files changed +2 -8 +3 -3
+2 -8
--- src/forum.c
+++ src/forum.c
@@ -902,11 +902,11 @@
902902
@ <span class='forum-status-selection'>
903903
if( forum_may_set_status(fp->fpid) ){
904904
@ <form method="post" action='%R/forumpost_status'>
905905
login_insert_csrf_secret();
906906
@ <input type='hidden' name='fpid' value='%s(fp->zUuid)' />
907
- @ <select name='status' data-fpid='%s(fp->zUuid)>'\
907
+ @ <select name='status' data-fpid='%s(fp->zUuid)'>\
908908
@ data-initial-value='%h(zCurrent ? zCurrent : "")'>
909909
for( i = 0; i < fss->n; ++i ){
910910
const ForumStatus * const fs = &fss->aStatus[i];
911911
@ <option value='%h(fs->zValue)'\
912912
@ %s(sCurrent==fs ? " selected" : "")>\
@@ -1819,24 +1819,19 @@
18191819
if( !cgi_csrf_safe(2) ){
18201820
webpage_error("CSRF validation failed");
18211821
}else{
18221822
const int fpid = validFpid>0 ? validFpid : forum_validate_fpid_param();
18231823
forumpost_tag(fpid, zTag, addTag, zVal);
1824
-#if 0
1825
- @ DEBUG frid=%d(fpid) addTag=%d(addTag) %h(zTag)=%h(zVal ? zVal : "NULL")
1826
-#else
18271824
cgi_redirectf("%R/forumpost/%S",P("fpid"));
1828
-#endif
18291825
}
18301826
}
18311827
18321828
/*
18331829
** WEBPAGE: forumpost_close hidden
18341830
** WEBPAGE: forumpost_reopen hidden
18351831
**
18361832
** fpid=X Hash of the post to be edited. REQUIRED
1837
-** reason=X Optional reason for closure.
18381833
**
18391834
** Closes or re-opens the given forum post, within the bounds of the
18401835
** API for forumpost_tag(). After (perhaps) modifying the "closed"
18411836
** status of the given thread, it redirects to that post's thread
18421837
** view. Requires admin privileges.
@@ -1845,12 +1840,11 @@
18451840
login_check_credentials();
18461841
if( forumpost_may_close()==0 ){
18471842
login_needed(g.anon.Admin);
18481843
}else{
18491844
const int bIsAdd = sqlite3_strglob("*_close*", g.zPath)==0;
1850
- char const *zReason = bIsAdd ? 0 : PD("reason", 0);
1851
- forumpost_action_helper("closed", zReason, bIsAdd, 0);
1845
+ forumpost_action_helper("closed", 0, bIsAdd, 0);
18521846
}
18531847
}
18541848
18551849
/*
18561850
** WEBPAGE: forumpost_status hidden
18571851
--- src/forum.c
+++ src/forum.c
@@ -902,11 +902,11 @@
902 @ <span class='forum-status-selection'>
903 if( forum_may_set_status(fp->fpid) ){
904 @ <form method="post" action='%R/forumpost_status'>
905 login_insert_csrf_secret();
906 @ <input type='hidden' name='fpid' value='%s(fp->zUuid)' />
907 @ <select name='status' data-fpid='%s(fp->zUuid)>'\
908 @ data-initial-value='%h(zCurrent ? zCurrent : "")'>
909 for( i = 0; i < fss->n; ++i ){
910 const ForumStatus * const fs = &fss->aStatus[i];
911 @ <option value='%h(fs->zValue)'\
912 @ %s(sCurrent==fs ? " selected" : "")>\
@@ -1819,24 +1819,19 @@
1819 if( !cgi_csrf_safe(2) ){
1820 webpage_error("CSRF validation failed");
1821 }else{
1822 const int fpid = validFpid>0 ? validFpid : forum_validate_fpid_param();
1823 forumpost_tag(fpid, zTag, addTag, zVal);
1824 #if 0
1825 @ DEBUG frid=%d(fpid) addTag=%d(addTag) %h(zTag)=%h(zVal ? zVal : "NULL")
1826 #else
1827 cgi_redirectf("%R/forumpost/%S",P("fpid"));
1828 #endif
1829 }
1830 }
1831
1832 /*
1833 ** WEBPAGE: forumpost_close hidden
1834 ** WEBPAGE: forumpost_reopen hidden
1835 **
1836 ** fpid=X Hash of the post to be edited. REQUIRED
1837 ** reason=X Optional reason for closure.
1838 **
1839 ** Closes or re-opens the given forum post, within the bounds of the
1840 ** API for forumpost_tag(). After (perhaps) modifying the "closed"
1841 ** status of the given thread, it redirects to that post's thread
1842 ** view. Requires admin privileges.
@@ -1845,12 +1840,11 @@
1845 login_check_credentials();
1846 if( forumpost_may_close()==0 ){
1847 login_needed(g.anon.Admin);
1848 }else{
1849 const int bIsAdd = sqlite3_strglob("*_close*", g.zPath)==0;
1850 char const *zReason = bIsAdd ? 0 : PD("reason", 0);
1851 forumpost_action_helper("closed", zReason, bIsAdd, 0);
1852 }
1853 }
1854
1855 /*
1856 ** WEBPAGE: forumpost_status hidden
1857
--- src/forum.c
+++ src/forum.c
@@ -902,11 +902,11 @@
902 @ <span class='forum-status-selection'>
903 if( forum_may_set_status(fp->fpid) ){
904 @ <form method="post" action='%R/forumpost_status'>
905 login_insert_csrf_secret();
906 @ <input type='hidden' name='fpid' value='%s(fp->zUuid)' />
907 @ <select name='status' data-fpid='%s(fp->zUuid)'>\
908 @ data-initial-value='%h(zCurrent ? zCurrent : "")'>
909 for( i = 0; i < fss->n; ++i ){
910 const ForumStatus * const fs = &fss->aStatus[i];
911 @ <option value='%h(fs->zValue)'\
912 @ %s(sCurrent==fs ? " selected" : "")>\
@@ -1819,24 +1819,19 @@
1819 if( !cgi_csrf_safe(2) ){
1820 webpage_error("CSRF validation failed");
1821 }else{
1822 const int fpid = validFpid>0 ? validFpid : forum_validate_fpid_param();
1823 forumpost_tag(fpid, zTag, addTag, zVal);
 
 
 
1824 cgi_redirectf("%R/forumpost/%S",P("fpid"));
 
1825 }
1826 }
1827
1828 /*
1829 ** WEBPAGE: forumpost_close hidden
1830 ** WEBPAGE: forumpost_reopen hidden
1831 **
1832 ** fpid=X Hash of the post to be edited. REQUIRED
 
1833 **
1834 ** Closes or re-opens the given forum post, within the bounds of the
1835 ** API for forumpost_tag(). After (perhaps) modifying the "closed"
1836 ** status of the given thread, it redirects to that post's thread
1837 ** view. Requires admin privileges.
@@ -1845,12 +1840,11 @@
1840 login_check_credentials();
1841 if( forumpost_may_close()==0 ){
1842 login_needed(g.anon.Admin);
1843 }else{
1844 const int bIsAdd = sqlite3_strglob("*_close*", g.zPath)==0;
1845 forumpost_action_helper("closed", 0, bIsAdd, 0);
 
1846 }
1847 }
1848
1849 /*
1850 ** WEBPAGE: forumpost_status hidden
1851
+3 -3
--- src/tag.c
+++ src/tag.c
@@ -1006,13 +1006,13 @@
10061006
}
10071007
10081008
10091009
/*
10101010
** If the given blob.rid value has the given tag applied to it,
1011
-** returns false and sets *pOut to a copy of its value (or NULL if it
1012
-** has no value). Else returns false and sets *pOut to 0.
1013
-** A truthy value returned is the associated tag.tagid value.
1011
+** returns true and sets *pOut to a copy of its value (or NULL if it
1012
+** has no value). Else returns false and sets *pOut to 0. A truthy
1013
+** value returned is the associated tag.tagid value.
10141014
**
10151015
** Ownership of *pOut is transfered to the caller, who must eventually
10161016
** fossil_free() it.
10171017
*/
10181018
int rid_has_tag2(int rid, const char *zTag, char **pOut){
10191019
--- src/tag.c
+++ src/tag.c
@@ -1006,13 +1006,13 @@
1006 }
1007
1008
1009 /*
1010 ** If the given blob.rid value has the given tag applied to it,
1011 ** returns false and sets *pOut to a copy of its value (or NULL if it
1012 ** has no value). Else returns false and sets *pOut to 0.
1013 ** A truthy value returned is the associated tag.tagid value.
1014 **
1015 ** Ownership of *pOut is transfered to the caller, who must eventually
1016 ** fossil_free() it.
1017 */
1018 int rid_has_tag2(int rid, const char *zTag, char **pOut){
1019
--- src/tag.c
+++ src/tag.c
@@ -1006,13 +1006,13 @@
1006 }
1007
1008
1009 /*
1010 ** If the given blob.rid value has the given tag applied to it,
1011 ** returns true and sets *pOut to a copy of its value (or NULL if it
1012 ** has no value). Else returns false and sets *pOut to 0. A truthy
1013 ** value returned is the associated tag.tagid value.
1014 **
1015 ** Ownership of *pOut is transfered to the caller, who must eventually
1016 ** fossil_free() it.
1017 */
1018 int rid_has_tag2(int rid, const char *zTag, char **pOut){
1019

Keyboard Shortcuts

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