Changeset 7768


Ignore:
Timestamp:
2004-07-19T17:36:08+12:00 (20 years ago)
Author:
davidb
Message:

Check added to make sure collection name is defined and non-empty

Location:
trunk/gsdl/cgi-bin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/cgi-bin/launch

    r7766 r7768  
    135135
    136136    my $col = clean_param($cgi,"c");
    137     if (defined $col) {
    138     $cgi->delete("c");
    139     $col = safe_val($col);
     137    if ((!defined $col) || ($col =~ m/^\s*$/)) {
     138    print "Content-type:text/plain\n\n";
     139    print "Error: No collection name specified\n";
     140    exit;
    140141    }
     142
     143    $cgi->delete("c");
     144    $col = safe_val($col);
    141145
    142146    if ($cmd eq "mkcol") {
  • trunk/gsdl/cgi-bin/upload

    r7766 r7768  
    3535    my $cgi = init_cgi();
    3636
    37     print STDERR "*** started upload script\n";
    38 
    3937    my ($gsdlhome) = usabcgi::get_config_info("gsdlhome");
    4038
     
    4341    $dir = "" if (($dir eq ".") || ($dir =~ m/^\.\./));
    4442
     43    if ((!defined $col) || ($col =~ m/^\s*$/)) {
     44    print "Content-type:text/plain\n\n";
     45    print "Error: No collection name specified\n";
     46    exit;
     47    }
     48
     49
    4550    my $zip_content = clean_param($cgi,"zip");
    4651    my $zip_fname = "$col.zip";
    4752
    4853    chdir "$gsdlhome/collect/";
    49     print STDERR "**** deleting $col/$dir\n";
    5054    `rm -rf $col/$dir`;
    5155
Note: See TracChangeset for help on using the changeset viewer.