--- parser3/src/classes/form.C 2012/03/16 09:24:07 1.43 +++ parser3/src/classes/form.C 2016/03/31 21:46:19 1.47 @@ -1,7 +1,7 @@ /** @file Parser: @b form parser class. - Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ @@ -11,7 +11,7 @@ #include "pa_request.h" #include "pa_vform.h" -volatile const char * IDENT_FORM_C="$Id: form.C,v 1.43 2012/03/16 09:24:07 moko Exp $"; +volatile const char * IDENT_FORM_C="$Id: form.C,v 1.47 2016/03/31 21:46:19 moko Exp $"; /// $LIMITS.max_post_size default 10M const size_t MAX_POST_SIZE_DEFAULT=10*0x400*0x400; @@ -32,7 +32,7 @@ public: // global variable -DECLARE_CLASS_VAR(form, 0/*fictive*/, new MForm); +DECLARE_CLASS_VAR(form, new MForm); // defines for statics @@ -51,7 +51,7 @@ static const String limits_name(LIMITS_N void MForm::configure_admin(Request& r) { Value* limits=r.main_class.get_element(limits_name); - if(r.request_info.method && StrStartFromNC(r.request_info.method, "post", true)) { + if(r.request_info.can_have_body()){ // $limits.max_post_size default 10M Value* element=limits?limits->get_element(max_post_size_name) :0; @@ -61,7 +61,7 @@ void MForm::configure_admin(Request& r) if(r.request_info.content_length>max_post_size) throw Exception(PARSER_RUNTIME, 0, - "posted content_length(%u) > $"LIMITS_NAME"."MAX_POST_SIZE_NAME"(%u)", + "posted content_length(%u) > $" LIMITS_NAME "." MAX_POST_SIZE_NAME "(%u)", r.request_info.content_length, max_post_size); // read POST data