Fossil SCM
/json/wiki/get argument handling cleanup so that it works with the newer command=... approach.
Commit
96fe10ab545495d115a8e7ee96d85f95f4434c22
Parent
af72cc7599d357f…
1 file changed
+7
-1
+7
-1
| --- src/json_wiki.c | ||
| +++ src/json_wiki.c | ||
| @@ -65,13 +65,19 @@ | ||
| 65 | 65 | if( !g.perm.RdWiki && !g.perm.Read ){ |
| 66 | 66 | json_set_err(FSL_JSON_E_DENIED, |
| 67 | 67 | "Requires 'o' or 'j' access."); |
| 68 | 68 | return NULL; |
| 69 | 69 | } |
| 70 | - zPageName = g.isHTTP | |
| 70 | + zPageName = (g.isHTTP || g.json.post.o) | |
| 71 | 71 | ? json_getenv_cstr("page") |
| 72 | 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 | + } | |
| 73 | 79 | if(!zPageName||!*zPageName){ |
| 74 | 80 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 75 | 81 | "'page' argument is missing."); |
| 76 | 82 | return NULL; |
| 77 | 83 | } |
| 78 | 84 |
| --- 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 |