Fossil SCM

Correctly handle embedded documentation pages that contain characters that require HTTP encoding.

drh 2014-05-27 20:36 trunk
Commit 5d4400400ae467c17efcc109dfe15c0dd27abe73
+2 -1
--- src/style.c
+++ src/style.c
@@ -299,11 +299,12 @@
299299
Th_Store("project_name", db_get("project-name","Unnamed Fossil Project"));
300300
Th_Store("title", zTitle);
301301
Th_Store("baseurl", g.zBaseURL);
302302
Th_Store("home", g.zTop);
303303
Th_Store("index_page", db_get("index-page","/home"));
304
- Th_Store("current_page", local_zCurrentPage ? local_zCurrentPage : g.zPath);
304
+ if( local_zCurrentPage==0 ) style_set_current_page("%T", g.zPath);
305
+ Th_Store("current_page", local_zCurrentPage);
305306
Th_Store("csrf_token", g.zCsrfToken);
306307
Th_Store("release_version", RELEASE_VERSION);
307308
Th_Store("manifest_version", MANIFEST_VERSION);
308309
Th_Store("manifest_date", MANIFEST_DATE);
309310
Th_Store("compiler_name", COMPILER_NAME);
310311
--- src/style.c
+++ src/style.c
@@ -299,11 +299,12 @@
299 Th_Store("project_name", db_get("project-name","Unnamed Fossil Project"));
300 Th_Store("title", zTitle);
301 Th_Store("baseurl", g.zBaseURL);
302 Th_Store("home", g.zTop);
303 Th_Store("index_page", db_get("index-page","/home"));
304 Th_Store("current_page", local_zCurrentPage ? local_zCurrentPage : g.zPath);
 
305 Th_Store("csrf_token", g.zCsrfToken);
306 Th_Store("release_version", RELEASE_VERSION);
307 Th_Store("manifest_version", MANIFEST_VERSION);
308 Th_Store("manifest_date", MANIFEST_DATE);
309 Th_Store("compiler_name", COMPILER_NAME);
310
--- src/style.c
+++ src/style.c
@@ -299,11 +299,12 @@
299 Th_Store("project_name", db_get("project-name","Unnamed Fossil Project"));
300 Th_Store("title", zTitle);
301 Th_Store("baseurl", g.zBaseURL);
302 Th_Store("home", g.zTop);
303 Th_Store("index_page", db_get("index-page","/home"));
304 if( local_zCurrentPage==0 ) style_set_current_page("%T", g.zPath);
305 Th_Store("current_page", local_zCurrentPage);
306 Th_Store("csrf_token", g.zCsrfToken);
307 Th_Store("release_version", RELEASE_VERSION);
308 Th_Store("manifest_version", MANIFEST_VERSION);
309 Th_Store("manifest_date", MANIFEST_DATE);
310 Th_Store("compiler_name", COMPILER_NAME);
311
+3 -3
--- src/wiki.c
+++ src/wiki.c
@@ -269,11 +269,11 @@
269269
if( g.perm.Hyperlink ){
270270
style_submenu_element("History", "History", "%s/whistory?name=%T",
271271
g.zTop, zPageName);
272272
}
273273
}
274
- style_set_current_page("%s?name=%T", g.zPath, zPageName);
274
+ style_set_current_page("%T?name=%T", g.zPath, zPageName);
275275
style_header(zPageName);
276276
blob_init(&wiki, zBody, -1);
277277
wiki_render_by_mimetype(&wiki, zMimetype);
278278
blob_reset(&wiki);
279279
attachment_list(zPageName, "<hr /><h2>Attachments:</h2><ul>");
@@ -439,11 +439,11 @@
439439
return;
440440
}
441441
if( zBody==0 ){
442442
zBody = mprintf("<i>Empty Page</i>");
443443
}
444
- style_set_current_page("%s?name=%T", g.zPath, zPageName);
444
+ style_set_current_page("%T?name=%T", g.zPath, zPageName);
445445
style_header("Edit: %s", zPageName);
446446
if( !goodCaptcha ){
447447
@ <p class="generalError">Error: Incorrect security code.</p>
448448
}
449449
blob_zero(&wiki);
@@ -667,11 +667,11 @@
667667
}
668668
if( P("cancel")!=0 ){
669669
cgi_redirectf("wiki?name=%T", zPageName);
670670
return;
671671
}
672
- style_set_current_page("%s?name=%T", g.zPath, zPageName);
672
+ style_set_current_page("%T?name=%T", g.zPath, zPageName);
673673
style_header("Append Comment To: %s", zPageName);
674674
if( !goodCaptcha ){
675675
@ <p class="generalError">Error: Incorrect security code.</p>
676676
}
677677
if( P("preview")!=0 ){
678678
--- src/wiki.c
+++ src/wiki.c
@@ -269,11 +269,11 @@
269 if( g.perm.Hyperlink ){
270 style_submenu_element("History", "History", "%s/whistory?name=%T",
271 g.zTop, zPageName);
272 }
273 }
274 style_set_current_page("%s?name=%T", g.zPath, zPageName);
275 style_header(zPageName);
276 blob_init(&wiki, zBody, -1);
277 wiki_render_by_mimetype(&wiki, zMimetype);
278 blob_reset(&wiki);
279 attachment_list(zPageName, "<hr /><h2>Attachments:</h2><ul>");
@@ -439,11 +439,11 @@
439 return;
440 }
441 if( zBody==0 ){
442 zBody = mprintf("<i>Empty Page</i>");
443 }
444 style_set_current_page("%s?name=%T", g.zPath, zPageName);
445 style_header("Edit: %s", zPageName);
446 if( !goodCaptcha ){
447 @ <p class="generalError">Error: Incorrect security code.</p>
448 }
449 blob_zero(&wiki);
@@ -667,11 +667,11 @@
667 }
668 if( P("cancel")!=0 ){
669 cgi_redirectf("wiki?name=%T", zPageName);
670 return;
671 }
672 style_set_current_page("%s?name=%T", g.zPath, zPageName);
673 style_header("Append Comment To: %s", zPageName);
674 if( !goodCaptcha ){
675 @ <p class="generalError">Error: Incorrect security code.</p>
676 }
677 if( P("preview")!=0 ){
678
--- src/wiki.c
+++ src/wiki.c
@@ -269,11 +269,11 @@
269 if( g.perm.Hyperlink ){
270 style_submenu_element("History", "History", "%s/whistory?name=%T",
271 g.zTop, zPageName);
272 }
273 }
274 style_set_current_page("%T?name=%T", g.zPath, zPageName);
275 style_header(zPageName);
276 blob_init(&wiki, zBody, -1);
277 wiki_render_by_mimetype(&wiki, zMimetype);
278 blob_reset(&wiki);
279 attachment_list(zPageName, "<hr /><h2>Attachments:</h2><ul>");
@@ -439,11 +439,11 @@
439 return;
440 }
441 if( zBody==0 ){
442 zBody = mprintf("<i>Empty Page</i>");
443 }
444 style_set_current_page("%T?name=%T", g.zPath, zPageName);
445 style_header("Edit: %s", zPageName);
446 if( !goodCaptcha ){
447 @ <p class="generalError">Error: Incorrect security code.</p>
448 }
449 blob_zero(&wiki);
@@ -667,11 +667,11 @@
667 }
668 if( P("cancel")!=0 ){
669 cgi_redirectf("wiki?name=%T", zPageName);
670 return;
671 }
672 style_set_current_page("%T?name=%T", g.zPath, zPageName);
673 style_header("Append Comment To: %s", zPageName);
674 if( !goodCaptcha ){
675 @ <p class="generalError">Error: Incorrect security code.</p>
676 }
677 if( P("preview")!=0 ){
678
--- test/release-checklist.wiki
+++ test/release-checklist.wiki
@@ -18,10 +18,13 @@
1818
<li><p>
1919
Click on each of the links in in the
2020
[./diff-test-1.wiki] document and verify that all diffs are
2121
rendered correctly.
2222
23
+<li><p>
24
+Click on the following link to verify that it works: [./test-page%2b%2b.wiki | ./test-page++.wiki]
25
+
2326
<li><p>
2427
Verify correct name-change tracking behavior (no net changes) for:
2528
<blockquote><b>
2629
fossil test-name-changes --debug b120bc8b262ac 374920b20944b
2730
</b></blockquote>
2831
2932
ADDED test/test-page++.wiki
--- test/release-checklist.wiki
+++ test/release-checklist.wiki
@@ -18,10 +18,13 @@
18 <li><p>
19 Click on each of the links in in the
20 [./diff-test-1.wiki] document and verify that all diffs are
21 rendered correctly.
22
 
 
 
23 <li><p>
24 Verify correct name-change tracking behavior (no net changes) for:
25 <blockquote><b>
26 fossil test-name-changes --debug b120bc8b262ac 374920b20944b
27 </b></blockquote>
28
29 DDED test/test-page++.wiki
--- test/release-checklist.wiki
+++ test/release-checklist.wiki
@@ -18,10 +18,13 @@
18 <li><p>
19 Click on each of the links in in the
20 [./diff-test-1.wiki] document and verify that all diffs are
21 rendered correctly.
22
23 <li><p>
24 Click on the following link to verify that it works: [./test-page%2b%2b.wiki | ./test-page++.wiki]
25
26 <li><p>
27 Verify correct name-change tracking behavior (no net changes) for:
28 <blockquote><b>
29 fossil test-name-changes --debug b120bc8b262ac 374920b20944b
30 </b></blockquote>
31
32 DDED test/test-page++.wiki
--- a/test/test-page++.wiki
+++ b/test/test-page++.wiki
@@ -0,0 +1,7 @@
1
+<title>Test Page</title>
2
+
3
+The purpose of this page is to test Fossil's ability to deal with
4
+embedded documentation pages that contain characters that should be
5
+escaped in URLs.
6
+
7
+Here is a link to the [./release-checklist.wiki | release checklist].
--- a/test/test-page++.wiki
+++ b/test/test-page++.wiki
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
--- a/test/test-page++.wiki
+++ b/test/test-page++.wiki
@@ -0,0 +1,7 @@
1 <title>Test Page</title>
2
3 The purpose of this page is to test Fossil's ability to deal with
4 embedded documentation pages that contain characters that should be
5 escaped in URLs.
6
7 Here is a link to the [./release-checklist.wiki | release checklist].

Keyboard Shortcuts

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