Changeset 16100 for greenstone3
- Timestamp:
- 2008-06-20T19:30:30+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
greenstone3/trunk/web/WEB-INF/cgi/gsdlCGI4gs3.pm
r16031 r16100 1 1 2 2 package gsdlCGI4gs3; 3 4 use strict; 5 no strict 'subs'; 6 no strict 'refs'; # allow filehandles to be variables and viceversa 3 7 4 8 use CGI; 5 9 use Cwd; 6 10 7 @ ISA = ('CGI');11 @gsdlCGI4gs3::ISA = ('CGI'); 8 12 9 13 sub new { 10 14 my $class = shift @_; 15 11 16 12 17 my $self; 13 18 if ((defined $ENV{'REQUEST_METHOD'}) && ($ENV{'REQUEST_METHOD'} eq "POST")) { 14 19 my $line = <STDIN>; 15 if ((defined $line) && ($line ne "") && ($line !~ /upload-collection-file/)) { 16 $self = new CGI($line); 20 # Multipart POST requests' boundaries created by Java's POST method on the client-GLI side 21 # start with --. If there are other kinds of languages and boundaries we will be dealing 22 # with, we can list those patterns alongside here in the (), separated by |: 23 my $multipartPostBoundary = q/^(--)/; 24 25 # cmd=upload-collection-file is not read into $line from STDIN, only the boundary (a 26 # sequence of chars preceeded by --) is encountered. Either we can match on POST requests 27 # whose cmds contain "download" OR we can look for $line NOT being boundary, to process $line. 28 # Multipart POST messages are processed by the zero-argument CGI constructor. 29 if ((defined $line) && ($line ne "") && ($line !~ /$multipartPostBoundary/)) { 30 $self = new CGI($line); 17 31 } 18 32 else { 19 33 $self = new CGI(); 20 34 } 21 } 35 } 22 36 else { 23 37 $self = new CGI(); … … 55 69 my $val = $self->SUPER::param($param); 56 70 $val =~ s/[\r\n]+$// if (defined $val); 57 71 58 72 return $val; 59 73 } … … 304 318 305 319 my $prefix_dir = getcwd(); 306 320 my $full_dir = &util::filename_cat($prefix_dir,$local_dir); 307 321 if ($prefix_dir !~ m/collect/) { 308 322 $self->generate_error("Trying to delete outside of Greenstone collect: $full_dir"); 309 323 } 310 311 my $full_dir = &util::filename_cat($prefix_dir,$local_dir);312 324 313 325 # Delete recursively
Note:
See TracChangeset
for help on using the changeset viewer.