lua: fix query string handling, the QUERY_STRING environment variable must not contai...
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 18 Mar 2013 14:35:09 +0000 (15:35 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 18 Mar 2013 14:36:17 +0000 (15:36 +0100)
lua.c

diff --git a/lua.c b/lua.c
index c6f27e91a56df3503f7f06c5e228e6aa9e54e9a0..55efaaa92c979c24c4c151e13854812d9530a7f7 100644 (file)
--- a/lua.c
+++ b/lua.c
@@ -218,7 +218,8 @@ static void lua_main(struct client *cl, struct path_info *pi, char *url)
        path_len = strlen(url);
        str = strchr(url, '?');
        if (str) {
-               pi->query = str;
+               if (*(str + 1))
+                       pi->query = str + 1;
                path_len = str - url;
        }
        if (path_len > prefix_len) {