X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Ffastcgi.c;h=94742bda2ac2d70a973a8d6a4906a0718a016c9c;hb=828cdbf49f52572e93c5c5a48e05277525a4055f;hp=19d286906f6bf44fbb7c12eeabe9aece740b67f4;hpb=40c784169ecaef20b626c00772b9f075e1a08de7;p=matches%2FMCTX3420.git diff --git a/server/fastcgi.c b/server/fastcgi.c index 19d2869..94742bd 100644 --- a/server/fastcgi.c +++ b/server/fastcgi.c @@ -591,10 +591,8 @@ void * FCGI_RequestLoop (void *data) //strncpy doesn't zero-truncate properly snprintf(module, BUFSIZ, "%s", getenv("DOCUMENT_URI_LOCAL")); - //Read from post body. If not empty, try GET instead. - if (fgets(params, BUFSIZ, stdin) == NULL || *params == '\0') { - snprintf(params, BUFSIZ, "%s", getenv("QUERY_STRING")); - } + //Get the GET query string + snprintf(params, BUFSIZ, "%s", getenv("QUERY_STRING")); //URL decode the parameters FCGI_URLDecode(params); @@ -653,6 +651,13 @@ void * FCGI_RequestLoop (void *data) //Escape all special characters. //Don't escape for login (password may have special chars?) FCGI_EscapeText(params); + } else { //Only for Login handler. + //If GET data is empty, use POST instead. + if (*params == '\0') { + Log(LOGDEBUG, "Using POST!"); + fgets(params, BUFSIZ, stdin); + FCGI_URLDecode(params); + } } module_handler(&context, params);