--- parser3/src/classes/file.C 2009/07/06 12:13:29 1.196 +++ parser3/src/classes/file.C 2009/08/08 13:30:20 1.199 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_FILE_C="$Date: 2009/07/06 12:13:29 $"; +static const char * const IDENT_FILE_C="$Date: 2009/08/08 13:30:20 $"; #include "pa_config_includes.h" @@ -43,7 +43,7 @@ extern String sql_offset_name; class MFile: public Methoded { public: // VStateless_class - Value* create_new_value(Pool&, HashStringValue*) { return new VFile(); } + Value* create_new_value(Pool&) { return new VFile(); } public: // Methoded bool used_directly() { return true; } @@ -276,12 +276,12 @@ static void _create(Request& r, MethodPa params.as_no_junction(1, FILE_NAME_MUST_NOT_BE_CODE).as_string()).taint_cstr(String::L_FILE_SPEC); const String& content=params.as_string(2, "content must be string"); - const char* content_cstr=content.untaint_cstr(String::L_AS_IS); // explode content, honor tainting changes + const String::Body content_body=content.cstr_to_string_body_untaint(String::L_AS_IS); // explode content, honor tainting changes VString* vcontent_type=new VString(r.mime_type_of(user_file_name_cstr)); VFile& self=GET_SELF(r, VFile); - self.set(true/*tainted*/, content_cstr, strlen(content_cstr), user_file_name_cstr, vcontent_type); + self.set(true/*tainted*/, content_body.cstr(), content_body.length(), user_file_name_cstr, vcontent_type); self.set_mode(true/*as_text*/); } @@ -452,7 +452,7 @@ static void _exec_cgi(Request& r, Method if(const String* sstdin=info.vstdin->get_string()) { in->append(*sstdin, String::L_CLEAN, true); } else - if(VFile* vfile=static_cast(info.vstdin->as("file", false))) + if(VFile* vfile=static_cast(info.vstdin->as("file"))) in->append_know_length((const char* )vfile->value_ptr(), vfile->value_size(), String::L_TAINTED); else throw Exception(PARSER_RUNTIME, @@ -619,7 +619,7 @@ static void _list(Request& r, MethodPara if(params.count()>1){ Value& regexp=params.as_no_junction(1, "regexp must not be code"); if(regexp.is_defined()){ - if(Value* value=regexp.as(VREGEX_TYPE, false)){ + if(Value* value=regexp.as(VREGEX_TYPE)){ vregex=static_cast(value); } else { vregex=new VRegex(r.charsets.source(), ®exp.as_string(), 0/*options*/); @@ -848,7 +848,7 @@ static void _sql(Request& r, MethodParam Temp_lang temp_lang(r, String::L_SQL); const String& statement_string=r.process_to_string(statement); - const char* statement_cstr=statement_string.untaint_cstr(String::L_AS_IS, r.connection()); + const char* statement_cstr=statement_string.untaint_cstr(r.flang, r.connection()); File_sql_event_handlers handlers(statement_string, statement_cstr);