Fossil SCM
Previous check-in broken the forum post edit function. Attempts to edit a forum post were disallowed. This check-in should fix the problem.
Commit
3684c58b4b3663b20a44ac74e214a7fe9c8ee9321ee6398f8db2cd4146abf83a
Parent
d2c81b9d6aed153…
1 file changed
+5
-2
+5
-2
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -1066,14 +1066,17 @@ | ||
| 1066 | 1066 | } |
| 1067 | 1067 | return; |
| 1068 | 1068 | } |
| 1069 | 1069 | } |
| 1070 | 1070 | isDelete = P("nullout")!=0; |
| 1071 | - if( P("submit") && (isDelete || !whitespace_only(zContent)) && isCsrfSafe ){ | |
| 1071 | + if( P("submit") | |
| 1072 | + && isCsrfSafe | |
| 1073 | + && (zContent = PDT("content",""))!=0 | |
| 1074 | + && (!whitespace_only(zContent) || isDelete) | |
| 1075 | + ){ | |
| 1072 | 1076 | int done = 1; |
| 1073 | 1077 | const char *zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE); |
| 1074 | - const char *zContent = PDT("content",""); | |
| 1075 | 1078 | if( P("reply") ){ |
| 1076 | 1079 | done = forum_post(0, fpid, 0, 0, zMimetype, zContent); |
| 1077 | 1080 | }else if( P("edit") || isDelete ){ |
| 1078 | 1081 | done = forum_post(P("title"), 0, fpid, 0, zMimetype, zContent); |
| 1079 | 1082 | }else{ |
| 1080 | 1083 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -1066,14 +1066,17 @@ | |
| 1066 | } |
| 1067 | return; |
| 1068 | } |
| 1069 | } |
| 1070 | isDelete = P("nullout")!=0; |
| 1071 | if( P("submit") && (isDelete || !whitespace_only(zContent)) && isCsrfSafe ){ |
| 1072 | int done = 1; |
| 1073 | const char *zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE); |
| 1074 | const char *zContent = PDT("content",""); |
| 1075 | if( P("reply") ){ |
| 1076 | done = forum_post(0, fpid, 0, 0, zMimetype, zContent); |
| 1077 | }else if( P("edit") || isDelete ){ |
| 1078 | done = forum_post(P("title"), 0, fpid, 0, zMimetype, zContent); |
| 1079 | }else{ |
| 1080 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -1066,14 +1066,17 @@ | |
| 1066 | } |
| 1067 | return; |
| 1068 | } |
| 1069 | } |
| 1070 | isDelete = P("nullout")!=0; |
| 1071 | if( P("submit") |
| 1072 | && isCsrfSafe |
| 1073 | && (zContent = PDT("content",""))!=0 |
| 1074 | && (!whitespace_only(zContent) || isDelete) |
| 1075 | ){ |
| 1076 | int done = 1; |
| 1077 | const char *zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE); |
| 1078 | if( P("reply") ){ |
| 1079 | done = forum_post(0, fpid, 0, 0, zMimetype, zContent); |
| 1080 | }else if( P("edit") || isDelete ){ |
| 1081 | done = forum_post(P("title"), 0, fpid, 0, zMimetype, zContent); |
| 1082 | }else{ |
| 1083 |