cvs: php4 /sapi/cgi cgi_main.c

From: Date: Thu, 22 Mar 2001 18:54:51 +0000
Subject: cvs: php4 /sapi/cgi cgi_main.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-4790@lists.php.net to get a copy of this message
joosters Thu Mar 22 10:54:51 2001 EDT Modified files: /php4/sapi/cgi cgi_main.c Log: Fix a bug with POST requests. If the Content-Type header wasn't present, we were setting SG(request_info).content_type to NULL, instead of an empty string. This was stopping PHP from processing the data. Index: php4/sapi/cgi/cgi_main.c diff -u php4/sapi/cgi/cgi_main.c:1.99 php4/sapi/cgi/cgi_main.c:1.100 --- php4/sapi/cgi/cgi_main.c:1.99 Wed Mar 7 05:24:12 2001 +++ php4/sapi/cgi/cgi_main.c Thu Mar 22 10:54:51 2001 @@ -263,6 +263,7 @@ static void init_request_info(SLS_D) { char *content_length = getenv("CONTENT_LENGTH"); + char *content_type = getenv("CONTENT_TYPE"); const char *auth; #if 0 @@ -311,7 +312,7 @@ SG(request_info).request_uri = getenv("SCRIPT_NAME"); } SG(request_info).path_translated = NULL; /* we have to update it later, when we have that information */ - SG(request_info).content_type = getenv("CONTENT_TYPE"); + SG(request_info).content_type = (content_type ? content_type : "" ); SG(request_info).content_length = (content_length?atoi(content_length):0); SG(sapi_headers).http_response_code = 200;

« previous php.cvs (#4790) next »