Fossil

Check-in [3684c58b]
Login

Check-in [3684c58b]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Previous check-in broken the forum post edit function. Attempts to edit a forum post were disallowed. This check-in should fix the problem.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3684c58b4b3663b20a44ac74e214a7fe9c8ee9321ee6398f8db2cd4146abf83a
User & Date: drh 2020-04-17 15:00:23
Context
2020-04-18
18:56
Use the XDG_CONFIG_HOME environment variable (if it exists) to locate the configuration database on unix. ... (check-in: 22f879dd user: drh tags: trunk)
00:12
Look in the XDG_CONFIG_HOME environment variable before looking in HOME for the location of the ".fossil" configuration database. ... (check-in: 4de54b1d user: drh tags: xdg-aware-config-db)
2020-04-17
15:00
Previous check-in broken the forum post edit function. Attempts to edit a forum post were disallowed. This check-in should fix the problem. ... (check-in: 3684c58b user: drh tags: trunk)
14:38
Do not allow forum posts that are replies or the start of a new message if they contain no content. An edit with no content is ok, as that means the post is to be deleted. ... (check-in: d2c81b9d user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/forum.c.
1064
1065
1066
1067
1068
1069
1070
1071




1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
      }else{
        cgi_redirectf("%R/forum");
      }
      return;
    }
  }
  isDelete = P("nullout")!=0;
  if( P("submit") && (isDelete || !whitespace_only(zContent)) && isCsrfSafe ){




    int done = 1;
    const char *zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE);
    const char *zContent = PDT("content","");
    if( P("reply") ){
      done = forum_post(0, fpid, 0, 0, zMimetype, zContent);
    }else if( P("edit") || isDelete ){
      done = forum_post(P("title"), 0, fpid, 0, zMimetype, zContent);
    }else{
      webpage_error("Missing 'reply' query parameter");
    }







|
>
>
>
>


<







1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077

1078
1079
1080
1081
1082
1083
1084
      }else{
        cgi_redirectf("%R/forum");
      }
      return;
    }
  }
  isDelete = P("nullout")!=0;
  if( P("submit")
   && isCsrfSafe
   && (zContent = PDT("content",""))!=0
   && (!whitespace_only(zContent) || isDelete)
  ){
    int done = 1;
    const char *zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE);

    if( P("reply") ){
      done = forum_post(0, fpid, 0, 0, zMimetype, zContent);
    }else if( P("edit") || isDelete ){
      done = forum_post(P("title"), 0, fpid, 0, zMimetype, zContent);
    }else{
      webpage_error("Missing 'reply' query parameter");
    }