Fossil SCM
Remove an unused feature from /forumpost_close. Fix a broken HTML tag. Remove some dead code. Correct some internal docs.
Commit
fe211fda591f6c12e8f6c62ee49da0ad8685ab43a09de6520a486010f30fcc62
Parent
57e21b8cfa61984…
2 files changed
+2
-8
+3
-3
+2
-8
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -902,11 +902,11 @@ | ||
| 902 | 902 | @ <span class='forum-status-selection'> |
| 903 | 903 | if( forum_may_set_status(fp->fpid) ){ |
| 904 | 904 | @ <form method="post" action='%R/forumpost_status'> |
| 905 | 905 | login_insert_csrf_secret(); |
| 906 | 906 | @ <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)'>\ | |
| 908 | 908 | @ data-initial-value='%h(zCurrent ? zCurrent : "")'> |
| 909 | 909 | for( i = 0; i < fss->n; ++i ){ |
| 910 | 910 | const ForumStatus * const fs = &fss->aStatus[i]; |
| 911 | 911 | @ <option value='%h(fs->zValue)'\ |
| 912 | 912 | @ %s(sCurrent==fs ? " selected" : "")>\ |
| @@ -1819,24 +1819,19 @@ | ||
| 1819 | 1819 | if( !cgi_csrf_safe(2) ){ |
| 1820 | 1820 | webpage_error("CSRF validation failed"); |
| 1821 | 1821 | }else{ |
| 1822 | 1822 | const int fpid = validFpid>0 ? validFpid : forum_validate_fpid_param(); |
| 1823 | 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 | 1824 | cgi_redirectf("%R/forumpost/%S",P("fpid")); |
| 1828 | -#endif | |
| 1829 | 1825 | } |
| 1830 | 1826 | } |
| 1831 | 1827 | |
| 1832 | 1828 | /* |
| 1833 | 1829 | ** WEBPAGE: forumpost_close hidden |
| 1834 | 1830 | ** WEBPAGE: forumpost_reopen hidden |
| 1835 | 1831 | ** |
| 1836 | 1832 | ** fpid=X Hash of the post to be edited. REQUIRED |
| 1837 | -** reason=X Optional reason for closure. | |
| 1838 | 1833 | ** |
| 1839 | 1834 | ** Closes or re-opens the given forum post, within the bounds of the |
| 1840 | 1835 | ** API for forumpost_tag(). After (perhaps) modifying the "closed" |
| 1841 | 1836 | ** status of the given thread, it redirects to that post's thread |
| 1842 | 1837 | ** view. Requires admin privileges. |
| @@ -1845,12 +1840,11 @@ | ||
| 1845 | 1840 | login_check_credentials(); |
| 1846 | 1841 | if( forumpost_may_close()==0 ){ |
| 1847 | 1842 | login_needed(g.anon.Admin); |
| 1848 | 1843 | }else{ |
| 1849 | 1844 | 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); | |
| 1852 | 1846 | } |
| 1853 | 1847 | } |
| 1854 | 1848 | |
| 1855 | 1849 | /* |
| 1856 | 1850 | ** WEBPAGE: forumpost_status hidden |
| 1857 | 1851 |
| --- 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 @@ | ||
| 1006 | 1006 | } |
| 1007 | 1007 | |
| 1008 | 1008 | |
| 1009 | 1009 | /* |
| 1010 | 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. | |
| 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 | 1014 | ** |
| 1015 | 1015 | ** Ownership of *pOut is transfered to the caller, who must eventually |
| 1016 | 1016 | ** fossil_free() it. |
| 1017 | 1017 | */ |
| 1018 | 1018 | int rid_has_tag2(int rid, const char *zTag, char **pOut){ |
| 1019 | 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 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 |