Fossil SCM

Fix the wiki editor so that it can handle wiki page names that include spaces.

drh 2007-10-10 15:21 trunk
Commit 9f89a8e68e6cf18256fe6af158cf18816b151ee7
2 files changed +5 -4 +1 -1
+5 -4
--- src/main.c
+++ src/main.c
@@ -481,19 +481,20 @@
481481
g.zPath = &zPath[1];
482482
for(i=1; zPath[i] && zPath[i]!='/'; i++){}
483483
if( zPath[i]=='/' ){
484484
zPath[i] = 0;
485485
g.zExtra = &zPath[i+1];
486
-
486
+ }else{
487
+ g.zExtra = 0;
488
+ }
489
+ g.zBaseURL = get_base_url();
490
+ if( g.zExtra ){
487491
/* CGI parameters get this treatment elsewhere, but places like getfile
488492
** will use g.zExtra directly.
489493
*/
490494
dehttpize(g.zExtra);
491
- }else{
492
- g.zExtra = 0;
493495
}
494
- g.zBaseURL = get_base_url();
495496
496497
/* Prevent robots from indexing this site.
497498
*/
498499
if( strcmp(g.zPath, "robots.txt")==0 ){
499500
cgi_set_content_type("text/plain");
500501
--- src/main.c
+++ src/main.c
@@ -481,19 +481,20 @@
481 g.zPath = &zPath[1];
482 for(i=1; zPath[i] && zPath[i]!='/'; i++){}
483 if( zPath[i]=='/' ){
484 zPath[i] = 0;
485 g.zExtra = &zPath[i+1];
486
 
 
 
 
487 /* CGI parameters get this treatment elsewhere, but places like getfile
488 ** will use g.zExtra directly.
489 */
490 dehttpize(g.zExtra);
491 }else{
492 g.zExtra = 0;
493 }
494 g.zBaseURL = get_base_url();
495
496 /* Prevent robots from indexing this site.
497 */
498 if( strcmp(g.zPath, "robots.txt")==0 ){
499 cgi_set_content_type("text/plain");
500
--- src/main.c
+++ src/main.c
@@ -481,19 +481,20 @@
481 g.zPath = &zPath[1];
482 for(i=1; zPath[i] && zPath[i]!='/'; i++){}
483 if( zPath[i]=='/' ){
484 zPath[i] = 0;
485 g.zExtra = &zPath[i+1];
486 }else{
487 g.zExtra = 0;
488 }
489 g.zBaseURL = get_base_url();
490 if( g.zExtra ){
491 /* CGI parameters get this treatment elsewhere, but places like getfile
492 ** will use g.zExtra directly.
493 */
494 dehttpize(g.zExtra);
 
 
495 }
 
496
497 /* Prevent robots from indexing this site.
498 */
499 if( strcmp(g.zPath, "robots.txt")==0 ){
500 cgi_set_content_type("text/plain");
501
+1 -1
--- src/wiki.c
+++ src/wiki.c
@@ -213,11 +213,11 @@
213213
for(n=2, z=zBody; z[0]; z++){
214214
if( z[0]=='\n' ) n++;
215215
}
216216
if( n<20 ) n = 20;
217217
if( n>200 ) n = 200;
218
- @ <form method="POST" action="%s(g.zBaseURL)/wikiedit/%s(g.zExtra)">
218
+ @ <form method="POST" action="%s(g.zBaseURL)/wikiedit/%t(g.zExtra)">
219219
@ <textarea name="w" class="wikiedit" cols="80"
220220
@ rows="%d(n)" wrap="virtual">%h(zBody)</textarea>
221221
@ <br>
222222
@ <input type="submit" name="preview" value="Preview Your Changes">
223223
@ <input type="submit" name="submit" value="Apply These Changes">
224224
--- src/wiki.c
+++ src/wiki.c
@@ -213,11 +213,11 @@
213 for(n=2, z=zBody; z[0]; z++){
214 if( z[0]=='\n' ) n++;
215 }
216 if( n<20 ) n = 20;
217 if( n>200 ) n = 200;
218 @ <form method="POST" action="%s(g.zBaseURL)/wikiedit/%s(g.zExtra)">
219 @ <textarea name="w" class="wikiedit" cols="80"
220 @ rows="%d(n)" wrap="virtual">%h(zBody)</textarea>
221 @ <br>
222 @ <input type="submit" name="preview" value="Preview Your Changes">
223 @ <input type="submit" name="submit" value="Apply These Changes">
224
--- src/wiki.c
+++ src/wiki.c
@@ -213,11 +213,11 @@
213 for(n=2, z=zBody; z[0]; z++){
214 if( z[0]=='\n' ) n++;
215 }
216 if( n<20 ) n = 20;
217 if( n>200 ) n = 200;
218 @ <form method="POST" action="%s(g.zBaseURL)/wikiedit/%t(g.zExtra)">
219 @ <textarea name="w" class="wikiedit" cols="80"
220 @ rows="%d(n)" wrap="virtual">%h(zBody)</textarea>
221 @ <br>
222 @ <input type="submit" name="preview" value="Preview Your Changes">
223 @ <input type="submit" name="submit" value="Apply These Changes">
224

Keyboard Shortcuts

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