Fossil

Check-in [4f0b0a6af2]
Login

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

Overview
Comment:Add 'th1-docs' setting to control whether or not TH1 scripts are allowed in embedded documentation files.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | dynamicTh1Docs
Files: files | file ages | folders
SHA1: 4f0b0a6af275977612a6ab7a246d7f1d391cfbaa
User & Date: mistachkin 2014-09-08 18:13:56.243
Context
2014-09-08
18:23
Improve page title handling. check-in: 67d5812c7f user: mistachkin tags: dynamicTh1Docs
18:13
Add 'th1-docs' setting to control whether or not TH1 scripts are allowed in embedded documentation files. check-in: 4f0b0a6af2 user: mistachkin tags: dynamicTh1Docs
08:08
Highly experimental changes to enable TH1 usage in embedded docs. Do not merge. check-in: 5ce57f21bd user: mistachkin tags: dynamicTh1Docs
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/configure.c.
95
96
97
98
99
100
101

102
103
104
105
106
107
108
  { "index-page",             CONFIGSET_SKIN },
  { "timeline-block-markup",  CONFIGSET_SKIN },
  { "timeline-max-comment",   CONFIGSET_SKIN },
  { "timeline-plaintext",     CONFIGSET_SKIN },
  { "adunit",                 CONFIGSET_SKIN },
  { "adunit-omit-if-admin",   CONFIGSET_SKIN },
  { "adunit-omit-if-user",    CONFIGSET_SKIN },

  { "th1-hooks",              CONFIGSET_TH1 },
  { "th1-setup",              CONFIGSET_TH1 },
  { "th1-uri-regexp",         CONFIGSET_TH1 },

#ifdef FOSSIL_ENABLE_TCL
  { "tcl",                    CONFIGSET_TH1 },
  { "tcl-setup",              CONFIGSET_TH1 },







>







95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
  { "index-page",             CONFIGSET_SKIN },
  { "timeline-block-markup",  CONFIGSET_SKIN },
  { "timeline-max-comment",   CONFIGSET_SKIN },
  { "timeline-plaintext",     CONFIGSET_SKIN },
  { "adunit",                 CONFIGSET_SKIN },
  { "adunit-omit-if-admin",   CONFIGSET_SKIN },
  { "adunit-omit-if-user",    CONFIGSET_SKIN },
  { "th1-docs",               CONFIGSET_TH1 },
  { "th1-hooks",              CONFIGSET_TH1 },
  { "th1-setup",              CONFIGSET_TH1 },
  { "th1-uri-regexp",         CONFIGSET_TH1 },

#ifdef FOSSIL_ENABLE_TCL
  { "tcl",                    CONFIGSET_TH1 },
  { "tcl-setup",              CONFIGSET_TH1 },
Changes to src/db.c.
2199
2200
2201
2202
2203
2204
2205

2206
2207
2208
2209
2210
2211
2212
  { "ssh-command",      0,             40, 0, 0, ""                    },
  { "ssl-ca-location",  0,             40, 0, 0, ""                    },
  { "ssl-identity",     0,             40, 0, 0, ""                    },
#ifdef FOSSIL_ENABLE_TCL
  { "tcl",              0,              0, 0, 0, "off"                 },
  { "tcl-setup",        0,             40, 1, 1, ""                    },
#endif

  { "th1-hooks",        0,              0, 0, 0, "off"                 },
  { "th1-setup",        0,             40, 1, 1, ""                    },
  { "th1-uri-regexp",   0,             40, 1, 0, ""                    },
  { "web-browser",      0,             32, 0, 0, ""                    },
  { "white-foreground", 0,              0, 0, 0, "off"                 },
  { 0,0,0,0,0,0 }
};







>







2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
  { "ssh-command",      0,             40, 0, 0, ""                    },
  { "ssl-ca-location",  0,             40, 0, 0, ""                    },
  { "ssl-identity",     0,             40, 0, 0, ""                    },
#ifdef FOSSIL_ENABLE_TCL
  { "tcl",              0,              0, 0, 0, "off"                 },
  { "tcl-setup",        0,             40, 1, 1, ""                    },
#endif
  { "th1-docs",         0,              0, 0, 0, "off"                 },
  { "th1-hooks",        0,              0, 0, 0, "off"                 },
  { "th1-setup",        0,             40, 1, 1, ""                    },
  { "th1-uri-regexp",   0,             40, 1, 0, ""                    },
  { "web-browser",      0,             32, 0, 0, ""                    },
  { "white-foreground", 0,              0, 0, 0, "off"                 },
  { 0,0,0,0,0,0 }
};
2406
2407
2408
2409
2410
2411
2412








2413
2414
2415
2416
2417
2418
2419
**                     scripts to be evaluated from TH1.  Additionally, the Tcl
**                     interpreter will be able to evaluate arbitrary TH1
**                     expressions and scripts. Default: off.
**
**    tcl-setup        This is the setup script to be evaluated after creating
**     (versionable)   and initializing the Tcl interpreter.  By default, this
**                     is empty and no extra setup is performed.








**
**    th1-hooks        If enabled (and Fossil was compiled with support for TH1
**                     hooks), special TH1 commands will be called before and
**                     after any Fossil command or web page. Default: off.
**
**    th1-setup        This is the setup script to be evaluated after creating
**     (versionable)   and initializing the TH1 interpreter.  By default, this







>
>
>
>
>
>
>
>







2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
**                     scripts to be evaluated from TH1.  Additionally, the Tcl
**                     interpreter will be able to evaluate arbitrary TH1
**                     expressions and scripts. Default: off.
**
**    tcl-setup        This is the setup script to be evaluated after creating
**     (versionable)   and initializing the Tcl interpreter.  By default, this
**                     is empty and no extra setup is performed.
**
**    th1-docs         WARNING: If enabled, this allows embedded documentation
**                     files to contain TH1 scripts that are evaluated on the
**                     server.  If native Tcl integration is also enabled, this
**                     setting has the potential to allow anybody with check-in
**                     privileges to do practically anything the associated
**                     operating system user account could do.  Extreme caution
**                     should be used when enabling this setting.
**
**    th1-hooks        If enabled (and Fossil was compiled with support for TH1
**                     hooks), special TH1 commands will be called before and
**                     after any Fossil command or web page. Default: off.
**
**    th1-setup        This is the setup script to be evaluated after creating
**     (versionable)   and initializing the TH1 interpreter.  By default, this
Changes to src/doc.c.
523
524
525
526
527
528
529

530
531
532
533
534
535
536
537
    style_footer();
  }else if( fossil_strcmp(zMime, "text/plain")==0 ){
    style_header("Documentation");
    @ <blockquote><pre>
    @ %h(blob_str(&filebody))
    @ </pre></blockquote>
    style_footer();

  }else if( fossil_strcmp(zMime, "application/x-th1")==0 ){
    style_header("Documentation");
    Th_Render(blob_str(&filebody));
    style_footer();
  }else{
    cgi_set_content_type(zMime);
    cgi_set_content(&filebody);
  }







>
|







523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
    style_footer();
  }else if( fossil_strcmp(zMime, "text/plain")==0 ){
    style_header("Documentation");
    @ <blockquote><pre>
    @ %h(blob_str(&filebody))
    @ </pre></blockquote>
    style_footer();
  }else if( db_get_boolean("th1-docs", 0) &&
            fossil_strcmp(zMime, "application/x-th1")==0 ){
    style_header("Documentation");
    Th_Render(blob_str(&filebody));
    style_footer();
  }else{
    cgi_set_content_type(zMime);
    cgi_set_content(&filebody);
  }