All pastes #1668320 Raw Edit

File upload patch

public diff v1 · immutable
#1668320 ·published 2009-11-12 15:35 UTC
rendered paste body
diff --git a/lib/Vend/Dispatch.pm b/lib/Vend/Dispatch.pmindex 5cd8375..f355743 100644--- a/lib/Vend/Dispatch.pm+++ b/lib/Vend/Dispatch.pm@@ -1155,6 +1155,14 @@ EOF 	set_file_permissions(); 	umask $Vend::Cfg->{Umask}; +	# convert uploaded files where necessary+	my ($name, $data);+	::logGlobal("CF: " . ref($CGI::file));+	+	while (($name, $data) = each %{$CGI::file}) {+	::logError("Name $name Data $data Encoding $CGI::file_encoding{$name}.");+	}+	 #show_times("end cgi and config mapping") if $Global::ShowTimes; 	open_database(); diff --git a/lib/Vend/Server.pm b/lib/Vend/Server.pmindex 12d102b..dc91c07 100644--- a/lib/Vend/Server.pm+++ b/lib/Vend/Server.pm@@ -477,13 +477,20 @@ sub parse_multipart { 			$content_type ||= 'text/plain'; 			$charset ||= default_charset(); ++			 			if ($content_type =~ m{^text/}i) { 				$charset and $Global::UTF8 and Vend::CharSet::to_internal($charset, \$data); 			}+			else {+				$charset = 'raw';+			}  			if($filename) { 				$CGI::file{$param} = $data;+				$CGI::file_encoding{$param} = $charset; 				$data = $filename;+							::logGlobal("P $param F $filename CT $content_type CH $charset."); 			} 			else { 				$data =~ s/\r?\n$//;