Fossil SCM

Reverted previous commit [1bf6cf832d] as it contains a major flaw of wiki links not being rendered. I tested on simple cases only, will reimplement in a way that allows wiki links to be rendered properly.

jeremy_c 2010-01-12 13:47 trunk
Commit b9897bb934c4de72a968d3bada8c985ae785672c
2 files changed -11 +10 -23
-11
--- src/setup.c
+++ src/setup.c
@@ -931,21 +931,10 @@
931931
@
932932
@ <p>The default "/home" page displays a Wiki page with the same name
933933
@ as the Project Name specified above. Some sites prefer to redirect
934934
@ to a documentation page (ex: "/doc/tip/index.wiki") or to "/timeline".</p>
935935
@ <hr />
936
- onoff_attribute("Enable ALL HTML tags and attributes on Wiki pages",
937
- "wiki-all-html", "wiki-all-html", 0);
938
- @ <p>Allow ALL HTML tags and attributes on Wiki pages. This should only
939
- @ be enabled when you trust all wiki contributors. By enabling this option
940
- @ it is possible for malicious users to insert dangerous HTML, CSS and
941
- @ JavaScript code. When this option is disabled, only safe HTML tags
942
- @ and attributes will be allowed.</p>
943
- @
944
- @ <p>It is highly recommended that this option not be enabled for public
945
- @ projects with open wiki's.</p>
946
- @ <hr />
947936
@ <p><input type="submit" name="submit" value="Apply Changes"></p>
948937
@ </form>
949938
db_end_transaction(0);
950939
style_footer();
951940
}
952941
--- src/setup.c
+++ src/setup.c
@@ -931,21 +931,10 @@
931 @
932 @ <p>The default "/home" page displays a Wiki page with the same name
933 @ as the Project Name specified above. Some sites prefer to redirect
934 @ to a documentation page (ex: "/doc/tip/index.wiki") or to "/timeline".</p>
935 @ <hr />
936 onoff_attribute("Enable ALL HTML tags and attributes on Wiki pages",
937 "wiki-all-html", "wiki-all-html", 0);
938 @ <p>Allow ALL HTML tags and attributes on Wiki pages. This should only
939 @ be enabled when you trust all wiki contributors. By enabling this option
940 @ it is possible for malicious users to insert dangerous HTML, CSS and
941 @ JavaScript code. When this option is disabled, only safe HTML tags
942 @ and attributes will be allowed.</p>
943 @
944 @ <p>It is highly recommended that this option not be enabled for public
945 @ projects with open wiki's.</p>
946 @ <hr />
947 @ <p><input type="submit" name="submit" value="Apply Changes"></p>
948 @ </form>
949 db_end_transaction(0);
950 style_footer();
951 }
952
--- src/setup.c
+++ src/setup.c
@@ -931,21 +931,10 @@
931 @
932 @ <p>The default "/home" page displays a Wiki page with the same name
933 @ as the Project Name specified above. Some sites prefer to redirect
934 @ to a documentation page (ex: "/doc/tip/index.wiki") or to "/timeline".</p>
935 @ <hr />
 
 
 
 
 
 
 
 
 
 
 
936 @ <p><input type="submit" name="submit" value="Apply Changes"></p>
937 @ </form>
938 db_end_transaction(0);
939 style_footer();
940 }
941
+10 -23
--- src/wiki.c
+++ src/wiki.c
@@ -193,17 +193,13 @@
193193
style_submenu_element("History", "History", "%s/whistory?name=%T",
194194
g.zTop, zPageName);
195195
}
196196
}
197197
style_header(zPageName);
198
- if (db_get_int("wiki-all-html",0)==1) {
199
- @ %s(zBody)
200
- } else {
201
- blob_init(&wiki, zBody, -1);
202
- wiki_convert(&wiki, 0, 0);
203
- blob_reset(&wiki);
204
- }
198
+ blob_init(&wiki, zBody, -1);
199
+ wiki_convert(&wiki, 0, 0);
200
+ blob_reset(&wiki);
205201
if( !isSandbox ){
206202
manifest_clear(&m);
207203
}
208204
style_footer();
209205
}
@@ -306,20 +302,16 @@
306302
zBody = mprintf("<i>Empty Page</i>");
307303
}
308304
zHtmlPageName = mprintf("Edit: %s", zPageName);
309305
style_header(zHtmlPageName);
310306
if( P("preview")!=0 ){
311
- @ Preview:<hr>
312
- if (db_get_int("wiki-all-html",0)==1) {
313
- @ %s(zBody)
314
- } else {
315
- blob_zero(&wiki);
316
- blob_append(&wiki, zBody, -1);
317
- wiki_convert(&wiki, 0, 0);
318
- blob_reset(&wiki);
319
- }
307
+ blob_zero(&wiki);
308
+ blob_append(&wiki, zBody, -1);
309
+ @ Preview:<hr>
310
+ wiki_convert(&wiki, 0, 0);
320311
@ <hr>
312
+ blob_reset(&wiki);
321313
}
322314
for(n=2, z=zBody; z[0]; z++){
323315
if( z[0]=='\n' ) n++;
324316
}
325317
if( n<20 ) n = 20;
@@ -488,19 +480,14 @@
488480
style_header(zHtmlPageName);
489481
if( P("preview")!=0 ){
490482
Blob preview;
491483
blob_zero(&preview);
492484
appendRemark(&preview);
493
-
494485
@ Preview:<hr>
495
- if (db_get_int("wiki-all-html",0)==1) {
496
- @ %s(blob_str(&preview))
497
- } else {
498
- wiki_convert(&preview, 0, 0);
499
- }
500
- blob_reset(&preview);
486
+ wiki_convert(&preview, 0, 0);
501487
@ <hr>
488
+ blob_reset(&preview);
502489
}
503490
zUser = PD("u", g.zLogin);
504491
@ <form method="POST" action="%s(g.zBaseURL)/wikiappend">
505492
login_insert_csrf_secret();
506493
@ <input type="hidden" name="name" value="%h(zPageName)">
507494
--- src/wiki.c
+++ src/wiki.c
@@ -193,17 +193,13 @@
193 style_submenu_element("History", "History", "%s/whistory?name=%T",
194 g.zTop, zPageName);
195 }
196 }
197 style_header(zPageName);
198 if (db_get_int("wiki-all-html",0)==1) {
199 @ %s(zBody)
200 } else {
201 blob_init(&wiki, zBody, -1);
202 wiki_convert(&wiki, 0, 0);
203 blob_reset(&wiki);
204 }
205 if( !isSandbox ){
206 manifest_clear(&m);
207 }
208 style_footer();
209 }
@@ -306,20 +302,16 @@
306 zBody = mprintf("<i>Empty Page</i>");
307 }
308 zHtmlPageName = mprintf("Edit: %s", zPageName);
309 style_header(zHtmlPageName);
310 if( P("preview")!=0 ){
311 @ Preview:<hr>
312 if (db_get_int("wiki-all-html",0)==1) {
313 @ %s(zBody)
314 } else {
315 blob_zero(&wiki);
316 blob_append(&wiki, zBody, -1);
317 wiki_convert(&wiki, 0, 0);
318 blob_reset(&wiki);
319 }
320 @ <hr>
 
321 }
322 for(n=2, z=zBody; z[0]; z++){
323 if( z[0]=='\n' ) n++;
324 }
325 if( n<20 ) n = 20;
@@ -488,19 +480,14 @@
488 style_header(zHtmlPageName);
489 if( P("preview")!=0 ){
490 Blob preview;
491 blob_zero(&preview);
492 appendRemark(&preview);
493
494 @ Preview:<hr>
495 if (db_get_int("wiki-all-html",0)==1) {
496 @ %s(blob_str(&preview))
497 } else {
498 wiki_convert(&preview, 0, 0);
499 }
500 blob_reset(&preview);
501 @ <hr>
 
502 }
503 zUser = PD("u", g.zLogin);
504 @ <form method="POST" action="%s(g.zBaseURL)/wikiappend">
505 login_insert_csrf_secret();
506 @ <input type="hidden" name="name" value="%h(zPageName)">
507
--- src/wiki.c
+++ src/wiki.c
@@ -193,17 +193,13 @@
193 style_submenu_element("History", "History", "%s/whistory?name=%T",
194 g.zTop, zPageName);
195 }
196 }
197 style_header(zPageName);
198 blob_init(&wiki, zBody, -1);
199 wiki_convert(&wiki, 0, 0);
200 blob_reset(&wiki);
 
 
 
 
201 if( !isSandbox ){
202 manifest_clear(&m);
203 }
204 style_footer();
205 }
@@ -306,20 +302,16 @@
302 zBody = mprintf("<i>Empty Page</i>");
303 }
304 zHtmlPageName = mprintf("Edit: %s", zPageName);
305 style_header(zHtmlPageName);
306 if( P("preview")!=0 ){
307 blob_zero(&wiki);
308 blob_append(&wiki, zBody, -1);
309 @ Preview:<hr>
310 wiki_convert(&wiki, 0, 0);
 
 
 
 
 
311 @ <hr>
312 blob_reset(&wiki);
313 }
314 for(n=2, z=zBody; z[0]; z++){
315 if( z[0]=='\n' ) n++;
316 }
317 if( n<20 ) n = 20;
@@ -488,19 +480,14 @@
480 style_header(zHtmlPageName);
481 if( P("preview")!=0 ){
482 Blob preview;
483 blob_zero(&preview);
484 appendRemark(&preview);
 
485 @ Preview:<hr>
486 wiki_convert(&preview, 0, 0);
 
 
 
 
 
487 @ <hr>
488 blob_reset(&preview);
489 }
490 zUser = PD("u", g.zLogin);
491 @ <form method="POST" action="%s(g.zBaseURL)/wikiappend">
492 login_insert_csrf_secret();
493 @ <input type="hidden" name="name" value="%h(zPageName)">
494

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button