ASF Bugzilla – Attachment 35926 Details for
Bug 62369
req:parseargs returns wrong result
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Diff file to patch lua_request.c
file_62369.txt (text/plain), 1.94 KB, created by
Massimiliano Calandrelli
on 2018-05-10 17:17:30 UTC
(
hide
)
Description:
Diff file to patch lua_request.c
Filename:
MIME Type:
Creator:
Massimiliano Calandrelli
Created:
2018-05-10 17:17:30 UTC
Size:
1.94 KB
patch
obsolete
>--- /home/max/httpd-2.4.33/modules/lua/lua_request.c 2017-07-05 00:28:38.000000000 +0200 >+++ lua_request.c 2018-05-10 18:47:32.491293762 +0200 >@@ -46,6 +46,40 @@ > typedef int (*req_field_int_f) (request_rec * r); > typedef req_table_t *(*req_field_apr_table_f) (request_rec * r); > >+static void >+argstr_to_table(char *str, apr_table_t *parms) >+{ >+ char *key; >+ char *value; >+ char *strtok_state; >+ >+ if (str == NULL) { >+ return; >+ } >+ >+ key = apr_strtok(str, "&", &strtok_state); >+ while (key) { >+ value = strchr(key, '='); >+ if (value) { >+ *value = '\0'; /* Split the string in two */ >+ value++; /* Skip passed the = */ >+ } >+ else { >+ value = "1"; >+ } >+ ap_unescape_url(key); >+ ap_unescape_url(value); >+ apr_table_add(parms, key, value); >+ key = apr_strtok(NULL, "&", &strtok_state); >+ } >+} >+ >+AP_DECLARE(void) ap_lua_args_to_table(request_rec *r, apr_table_t **table) >+{ >+ apr_table_t *t = apr_table_make(r->pool, 10); >+ argstr_to_table(apr_pstrdup(r->pool, r->args), t); >+ *table = t; >+} > > void ap_lua_rstack_dump(lua_State *L, request_rec *r, const char *msg) > { >@@ -314,7 +348,7 @@ > request_rec *r = ap_lua_check_request_rec(L, 1); > lua_newtable(L); > lua_newtable(L); /* [table, table] */ >- ap_args_to_table(r, &form_table); >+ ap_lua_args_to_table(r, &form_table); > apr_table_do(req_aprtable2luatable_cb, L, form_table, NULL); > return 2; /* [table<string, string>, table<string, array<string>>] */ > } >@@ -497,7 +531,7 @@ > const char *name = luaL_checkstring(L, 2); > ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01485) "adding output filter %s", > name); >- ap_add_output_filter(name, L, r, r->connection); >+ ap_add_output_filter(name, NULL, r, r->connection); > return 0; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 62369
: 35926