Changeset 7922


Ignore:
Timestamp:
2004-08-10T11:21:08+12:00 (20 years ago)
Author:
davidb
Message:

Improved checking of cgi arguments.

File:
1 edited

Legend:

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

    r7800 r7922  
    3535    # ensure only alpha-numeric plus a few other special chars
    3636
    37     $val =~ s/[^[:alnum:]@\.\/\-]//g if (defined $val);
     37    $val =~ s/[^[:alnum:]@\.\/\- :]//g if (defined $val);
    3838
    3939    return $val;
     
    5050    foreach my $k ( @arg_keys ) {
    5151    my $arg_val = clean_param($cgi,$k);
    52     # ensure only alphanumeric, plus a few special chars
    53     $arg_val = safe_val($arg_val);
    54     $cmd .= " -$k $arg_val"
     52    if ($k eq "about") {
     53        # special case (allow most things, but not quotes)
     54        $arg_val =~ s/\"/"/g;
     55    }
     56    else {
     57        # ensure only alphanumeric, plus a few special chars
     58        $arg_val = safe_val($arg_val);
     59    }
     60    $cmd .= " -$k";
     61    if ($arg_val ne "") {
     62        $cmd .= " \"$arg_val\"";
     63    }
    5564    }
    5665
     
    93102    if (defined $col) {
    94103        chdir("collect/$col");
    95         `rm -rf index/*; cp -r building/. index/.`;
     104        `rm -rf index; cp -r building index`;
    96105        chdir("../..");
    97106    }
Note: See TracChangeset for help on using the changeset viewer.