Fossil SCM

/json/wiki/get argument handling cleanup so that it works with the newer command=... approach.

stephan 2011-10-04 09:06 UTC json-multitag-test
Commit 96fe10ab545495d115a8e7ee96d85f95f4434c22
1 file changed +7 -1
+7 -1
--- src/json_wiki.c
+++ src/json_wiki.c
@@ -65,13 +65,19 @@
6565
if( !g.perm.RdWiki && !g.perm.Read ){
6666
json_set_err(FSL_JSON_E_DENIED,
6767
"Requires 'o' or 'j' access.");
6868
return NULL;
6969
}
70
- zPageName = g.isHTTP
70
+ zPageName = (g.isHTTP || g.json.post.o)
7171
? json_getenv_cstr("page")
7272
: find_option("page","p",1);
73
+ if( !zPageName && cson_value_is_string(g.json.reqPayload.v) ){
74
+ zPageName = cson_string_cstr(cson_value_get_string(g.json.reqPayload.v));
75
+ }
76
+ if(!zPageName){
77
+ zPageName = json_command_arg(g.json.dispatchDepth+1);
78
+ }
7379
if(!zPageName||!*zPageName){
7480
json_set_err(FSL_JSON_E_MISSING_ARGS,
7581
"'page' argument is missing.");
7682
return NULL;
7783
}
7884
--- src/json_wiki.c
+++ src/json_wiki.c
@@ -65,13 +65,19 @@
65 if( !g.perm.RdWiki && !g.perm.Read ){
66 json_set_err(FSL_JSON_E_DENIED,
67 "Requires 'o' or 'j' access.");
68 return NULL;
69 }
70 zPageName = g.isHTTP
71 ? json_getenv_cstr("page")
72 : find_option("page","p",1);
 
 
 
 
 
 
73 if(!zPageName||!*zPageName){
74 json_set_err(FSL_JSON_E_MISSING_ARGS,
75 "'page' argument is missing.");
76 return NULL;
77 }
78
--- src/json_wiki.c
+++ src/json_wiki.c
@@ -65,13 +65,19 @@
65 if( !g.perm.RdWiki && !g.perm.Read ){
66 json_set_err(FSL_JSON_E_DENIED,
67 "Requires 'o' or 'j' access.");
68 return NULL;
69 }
70 zPageName = (g.isHTTP || g.json.post.o)
71 ? json_getenv_cstr("page")
72 : find_option("page","p",1);
73 if( !zPageName && cson_value_is_string(g.json.reqPayload.v) ){
74 zPageName = cson_string_cstr(cson_value_get_string(g.json.reqPayload.v));
75 }
76 if(!zPageName){
77 zPageName = json_command_arg(g.json.dispatchDepth+1);
78 }
79 if(!zPageName||!*zPageName){
80 json_set_err(FSL_JSON_E_MISSING_ARGS,
81 "'page' argument is missing.");
82 return NULL;
83 }
84

Keyboard Shortcuts

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