Fossil

Check-in [5a0dbf97]
Login

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

Overview
Comment:Move loop variable declaration out of for loop for C89 happiness.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | technoteattachcli
Files: files | file ages | folders
SHA1:5a0dbf97ba551d294b24e42cb5cce678d9a0d3cf
User & Date: rberteig 2016-05-03 07:11:17
Context
2016-05-03
08:17
Merged trunk and resolved conflicts. Passes all current tests, except for tests wiki-15 and wiki-15.1 in wiki.test. check-in: 8c8ccac9 user: rberteig tags: technoteattachcli
07:11
Move loop variable declaration out of for loop for C89 happiness. check-in: 5a0dbf97 user: rberteig tags: technoteattachcli
2016-04-18
19:18
Sanitize the mimetypes on both the CLI and json. Allow more friendly names for the supported mimetypes as well as the formal mimetypes check-in: 7ed9c7e4 user: dave.vines tags: technoteattachcli
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/wiki.c.

135
136
137
138
139
140
141

142
143
144
145
146
147
148
149

/*
** Only allow certain mimetypes through.
** All others become "text/x-fossil-wiki"
*/
const char *wiki_filter_mimetypes(const char *zMimetype){
  if( zMimetype!=0 ){

    for(int i=0; i<sizeof(azStyles)/sizeof(azStyles[0]); i+=3){
      if( fossil_strcmp(zMimetype,azStyles[i+2])==0 ){
        return azStyles[i];
      }
    }
    if(  fossil_strcmp(zMimetype, "text/x-markdown")==0
        || fossil_strcmp(zMimetype, "text/plain")==0 ){
      return zMimetype;







>
|







135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150

/*
** Only allow certain mimetypes through.
** All others become "text/x-fossil-wiki"
*/
const char *wiki_filter_mimetypes(const char *zMimetype){
  if( zMimetype!=0 ){
    int i;    
    for(i=0; i<sizeof(azStyles)/sizeof(azStyles[0]); i+=3){
      if( fossil_strcmp(zMimetype,azStyles[i+2])==0 ){
        return azStyles[i];
      }
    }
    if(  fossil_strcmp(zMimetype, "text/x-markdown")==0
        || fossil_strcmp(zMimetype, "text/plain")==0 ){
      return zMimetype;