Fossil SCM
Fix the wiki editor so that it can handle wiki page names that include spaces.
Commit
9f89a8e68e6cf18256fe6af158cf18816b151ee7
Parent
29bc8da1d925784…
2 files changed
+5
-4
+1
-1
+5
-4
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -481,19 +481,20 @@ | ||
| 481 | 481 | g.zPath = &zPath[1]; |
| 482 | 482 | for(i=1; zPath[i] && zPath[i]!='/'; i++){} |
| 483 | 483 | if( zPath[i]=='/' ){ |
| 484 | 484 | zPath[i] = 0; |
| 485 | 485 | g.zExtra = &zPath[i+1]; |
| 486 | - | |
| 486 | + }else{ | |
| 487 | + g.zExtra = 0; | |
| 488 | + } | |
| 489 | + g.zBaseURL = get_base_url(); | |
| 490 | + if( g.zExtra ){ | |
| 487 | 491 | /* CGI parameters get this treatment elsewhere, but places like getfile |
| 488 | 492 | ** will use g.zExtra directly. |
| 489 | 493 | */ |
| 490 | 494 | dehttpize(g.zExtra); |
| 491 | - }else{ | |
| 492 | - g.zExtra = 0; | |
| 493 | 495 | } |
| 494 | - g.zBaseURL = get_base_url(); | |
| 495 | 496 | |
| 496 | 497 | /* Prevent robots from indexing this site. |
| 497 | 498 | */ |
| 498 | 499 | if( strcmp(g.zPath, "robots.txt")==0 ){ |
| 499 | 500 | cgi_set_content_type("text/plain"); |
| 500 | 501 |
| --- 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 @@ | ||
| 213 | 213 | for(n=2, z=zBody; z[0]; z++){ |
| 214 | 214 | if( z[0]=='\n' ) n++; |
| 215 | 215 | } |
| 216 | 216 | if( n<20 ) n = 20; |
| 217 | 217 | 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)"> | |
| 219 | 219 | @ <textarea name="w" class="wikiedit" cols="80" |
| 220 | 220 | @ rows="%d(n)" wrap="virtual">%h(zBody)</textarea> |
| 221 | 221 | @ <br> |
| 222 | 222 | @ <input type="submit" name="preview" value="Preview Your Changes"> |
| 223 | 223 | @ <input type="submit" name="submit" value="Apply These Changes"> |
| 224 | 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/%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 |