--- parser3/src/classes/file.C 2007/02/26 13:42:27 1.152 +++ parser3/src/classes/file.C 2007/04/16 10:08:17 1.155 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_FILE_C="$Date: 2007/02/26 13:42:27 $"; +static const char * const IDENT_FILE_C="$Date: 2007/04/16 10:08:17 $"; #include "pa_config_includes.h" @@ -185,7 +185,7 @@ static void _copy(Request& r, MethodPara String from_spec = r.absolute(vfrom_file_name.as_string()); const String& to_spec = r.absolute(vto_file_name.as_string()); - create_dir_for_file(to_spec); + // create_dir_for_file(to_spec); file_write_action_under_lock( to_spec, @@ -345,6 +345,13 @@ static void pass_cgi_header_attribute( info->content_type=value; } } + +static void append_to_argv(Request& r, ArrayString& argv, const String* str){ + if( str->length() ){ + argv+=new String(str->cstr_to_string_body(String::L_UNSPECIFIED, 0, &r.charsets), String::L_AS_IS); + } +} + /// @todo fix `` in perl - they produced flipping consoles and no output to perl static void _exec_cgi(Request& r, MethodParams& params, bool cgi) { @@ -428,10 +435,24 @@ static void _exec_cgi(Request& r, Method // influence tainting // main target -- URLencoding of tainted pieces to String::L_URI lang Temp_client_charset temp(r.charsets, charset? *charset: r.charsets.source()); + for(size_t i=2; i 0) { - argv+=new String(param.cstr_to_string_body(String::L_UNSPECIFIED, 0, &r.charsets), String::L_AS_IS); + Value& param=params.as_no_junction(i, "parameter must not be code"); + if(param.is_defined()){ + if(param.is_string()){ + append_to_argv(r, argv, param.get_string()); + } else { + Table* table=param.get_table(); + if(table){ + for(size_t i=0; icount(); i++) { + append_to_argv(r, argv, table->get(i)->get(0)); + } + } else { + throw Exception("parser.runtime", + 0, + "parameter must be string or table"); + } + } } } }