--- parser3/src/classes/form.C 2003/04/02 10:10:00 1.34.2.7.2.7 +++ parser3/src/classes/form.C 2005/08/09 08:14:47 1.39 @@ -1,11 +1,11 @@ /** @file Parser: @b form parser class. - Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_FORM_C="$Date: 2003/04/02 10:10:00 $"; +static const char * const IDENT_FORM_C="$Date: 2005/08/09 08:14:47 $"; #include "classes.h" #include "pa_vmethod_frame.h" @@ -61,22 +61,20 @@ void MForm::configure_admin(Request& r) if(r.request_info.content_length>max_post_size) throw Exception("parser.runtime", 0, - "posted content_length(%u) > max_post_size(%u)", + "posted content_length(%u) > $"LIMITS_NAME"."MAX_POST_SIZE_NAME"(%u)", r.request_info.content_length, max_post_size); - if(r.request_info.content_length<0) - throw Exception(0, - 0, - "posted content_length(%u) < 0", - r.request_info.content_length); // read POST data if(r.request_info.content_length) { - char *post_data=new(PointerFreeGC) char[r.request_info.content_length+0/*terminating zero*/]; + char *post_data=new(PointerFreeGC) char[r.request_info.content_length+1/*terminating zero*/]; size_t post_size=SAPI::read_post(r.sapi_info, post_data, r.request_info.content_length); post_data[post_size]=0; // terminating zero r.request_info.post_data=post_data; r.request_info.post_size=post_size; + } else { + r.request_info.post_data=0; + r.request_info.post_size=0; } if(r.request_info.post_size!=r.request_info.content_length) throw Exception(0,