Changeset 16109
- Timestamp:
- 2008-06-23T17:11:02+12:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
greenstone3/trunk/web/WEB-INF/cgi/gsdlCGI.pm
r16106 r16109 10 10 use Cwd; 11 11 12 @gsdlCGI::ISA = ( 'CGI' ); #@gsdlCGI::ISA = qw( CGI ); 13 #@ISA = ('CGI'); # syntax error of some kind when using strict 12 @gsdlCGI::ISA = ( 'CGI' ); 14 13 15 14 sub new { 16 15 my $class = shift @_; 17 16 18 17 my $self; 19 18 … … 30 29 31 30 if ((defined $ENV{'REQUEST_METHOD'}) && ($ENV{'REQUEST_METHOD'} eq "POST")) { 32 my $line = <STDIN>; 33 # Multipart POST requests' boundaries created by Java's POST method on the client-GLI side 34 # start with --. If there are other kinds of languages and boundaries we will be dealing 35 # with, we can list those patterns alongside here in the (), separated by |: 36 my $multipartPostBoundary = q/^(--)/; 37 38 # cmd=upload-collection-file is not read into $line from STDIN, only the boundary (a 39 # sequence of chars preceeded by --) is encountered. Either we can match on POST requests 40 # whose cmds contain "download" OR we can look for $line NOT being boundary, to process $line. 41 # Multipart POST messages are processed by the zero-argument CGI constructor. 42 if ((defined $line) && ($line ne "") && ($line !~ /$multipartPostBoundary/)) { #&& ($line =~ /download/)) { 43 $self = new CGI($line); 44 } 31 32 # Check if we're dealing with the upload-coll-file cmd. Because it will be a 33 # multipart POST message and must be dealt with by the default CGI() constructor 34 if((defined $ENV{'QUERY_STRING'}) && ($ENV{'QUERY_STRING'} =~ /upload-collection-file/)) { 35 $self = new CGI(); 36 } 37 38 else { # all other POST commands processed using CGI($line) 39 my $line = <STDIN>; 40 if ((defined $line) && ($line ne "")) { 41 $self = new CGI($line); 42 } 43 } 44 45 45 } 46 47 # If one of the conditions above did not hold, then self=new CGI. 48 # This includes multipart post boundaries as are sent for cmd=upload-collection-file, 49 # which should also be processed by the zero-argument CGI constructor. 46 47 # If one of the conditions above did not hold, then self=new CGI() 50 48 if (!defined $self) { 51 49 $self = new CGI();
Note:
See TracChangeset
for help on using the changeset viewer.