Ignore:
Timestamp:
2008-07-15T12:20:55+12:00 (16 years ago)
Author:
ak19
Message:

Minor. Now tests for matches using m/something/ rather than /something/

Location:
greenstone3/trunk/web/WEB-INF/cgi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/web/WEB-INF/cgi/gliserver.pl

    r16376 r16405  
    203203    my $java_classpath;
    204204    my $gsdlos = $ENV{'GSDLOS'};
    205     if ($gsdlos !~ /windows/){
     205    if ($gsdlos !~ m/windows/){
    206206        $java_classpath = $java_gsdl3_classpath . ":" . $java_derby_classpath;
    207207    }else{
     
    217217    my %users_db_data = ();
    218218    foreach my $users_db_entry (split(/-{70}/, $users_db_content)) {
    219     if ($users_db_entry =~ /\n?\[(.+)\]\n/) {
     219    if ($users_db_entry =~ m/\n?\[(.+)\]\n/) {
    220220        $users_db_data{$1} = $users_db_entry;
    221221    }
     
    229229
    230230    # Check password
    231     my ($valid_user_password) = ($user_data =~ /\<password\>(.*)/);
     231    my ($valid_user_password) = ($user_data =~ m/\<password\>(.*)/);
    232232    if ($user_password ne $valid_user_password) {
    233233    $gsdl_cgi->generate_error("Authentication failed: incorrect password.");
     
    235235
    236236    # Check group
    237     my ($user_groups) = ($user_data =~ /\<groups\>(.*)/);
     237    my ($user_groups) = ($user_data =~ m/\<groups\>(.*)/);
    238238
    239239    if ($collection eq "") {
     
    248248    }
    249249    # Does this user have access to personal collections, and is this one?
    250     if ($user_group eq "personal-collections-editor" && $collection =~ /^$username\-/) {
     250    if ($user_group eq "personal-collections-editor" && $collection =~ m/^$username\-/) {
    251251        return $user_groups;  # Authentication successful
    252252    }
     
    285285
    286286    # Pick out the owner of the lock file
    287     $lock_file_content =~ /\<User\>(.*?)\<\/User\>/;
     287    $lock_file_content =~ m/\<User\>(.*?)\<\/User\>/;
    288288    my $lock_file_owner = $1;
    289289
     
    317317#   ACTIONS
    318318# ----------------------------------------------------------------------------------------------------
    319 # This routine won't get called by GS2, so uses the variable site
     319# This routine, which uses the variable site, won't get called by GS2,
    320320sub user_validation{
    321321    my ($gsdl_cgi, $username, $timestamp, $site) = @_;
     
    323323    # Users can be in any group to perform this action
    324324    my $user_err = &authenticate_user($gsdl_cgi, $username, "", $site);
    325      if (defined $user_err && $user_err!~ /ERROR/){
    326      if ($user_err!~ /ERROR/){
     325     if (defined $user_err && $user_err!~ m/ERROR/){
     326     if ($user_err!~ m/ERROR/){
    327327         #$gsdl_cgi->generate_error("Authentication failed: $username is not valid");
    328328         $gsdl_cgi->generate_ok($user_err);
     
    450450
    451451    # Make sure we don't try to delete anything outside the collection
    452     if ($file =~ /\.\./) {
     452    if ($file =~ m/\.\./) {
    453453    $gsdl_cgi->generate_error("Illegal file specified.");
    454454    }
     
    658658
    659659    # Make sure we don't try to download anything outside the collection
    660     if ($file =~ /\.\./) {
     660    if ($file =~ m/\.\./) {
    661661    $gsdl_cgi->generate_error("Illegal file specified.");
    662662    }
     
    714714
    715715    # Make sure we don't try to download anything else
    716     if ($file =~ /\.\./) {
     716    if ($file =~ m/\.\./) {
    717717    $gsdl_cgi->generate_error("Illegal file specified.");
    718718    }
     
    868868
    869869    # Make sure we don't try to move anything outside the collection
    870     if ($source_file =~ /\.\./ || $target_file =~ /\.\./) {
     870    if ($source_file =~ m/\.\./ || $target_file =~ m/\.\./) {
    871871    $gsdl_cgi->generate_error("Illegal file specified.");
    872872    }
     
    912912
    913913    # Make sure we don't try to create anything outside the collection
    914     if ($directory =~ /\.\./) {
     914    if ($directory =~ m/\.\./) {
    915915    $gsdl_cgi->generate_error("Illegal directory specified.");
    916916    }
     
    997997    my $import_pl = "import.pl"; # import is a reserved word, need to put it in quotes
    998998   
    999     if (($script =~ /$import_pl|buildcol.pl/) || ($script eq "mkcol.pl")) { # || ($script eq "schedule.pl")
     999    if (($script =~ m/$import_pl|buildcol.pl/) || ($script eq "mkcol.pl")) { # || ($script eq "schedule.pl")
    10001000    my $collect_directory = $gsdl_cgi->get_collection_dir($site);
    10011001    $perl_args = $perl_args . " -collectdir \"$collect_directory\"";
     
    10491049
    10501050    # Make sure we don't try to upload anything outside the collection
    1051     if ($file =~ /\.\./) {
     1051    if ($file =~ m/\.\./) {
    10521052    $gsdl_cgi->generate_error("Illegal file specified.");
    10531053    }
    1054     if ($directory =~ /\.\./) {
     1054    if ($directory =~ m/\.\./) {
    10551055    $gsdl_cgi->generate_error("Illegal directory specified.");
    10561056    }
  • greenstone3/trunk/web/WEB-INF/cgi/gsdlCGI.pm

    r16385 r16405  
    3232    # Check if we're dealing with the upload-coll-file cmd. Because it will be a
    3333    # 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/)) {
     34    if((defined $ENV{'QUERY_STRING'}) && ($ENV{'QUERY_STRING'} =~ m/upload-collection-file/)) {
    3535        $self = new CGI();
    3636    }
     
    302302    return "linux";
    303303    }
    304     elsif ($os =~ /mswin/i) {
     304    elsif ($os =~ m/mswin/i) {
    305305    return "windows";
    306306    }
    307     elsif ($os =~ /macos/i) {
     307    elsif ($os =~ m/macos/i) {
    308308    return "darwin";
    309309    }
     
    333333
    334334        my $gsdlos = (defined $ENV{'GSDLOS'}) ? $ENV{'GSDLOS'} : $self->get_gsdl_os();
    335         if($gsdlos =~ /windows/) { # remote GS2 server on Windows uses "library.exe"
     335        if($gsdlos =~ m/windows/) { # remote GS2 server on Windows uses "library.exe"
    336336        $library_url .= ".exe";
    337337        }
     
    405405    my $gsdl_bin_script = &util::filename_cat($gsdlhome,"bin","script");
    406406    &util::envvar_append("PATH",$gsdl_bin_script);
    407 
     407   
    408408    my $gsdl_bin_os = &util::filename_cat($gsdlhome,"bin",$gsdlos);
    409409    &util::envvar_append("PATH",$gsdl_bin_os);
Note: See TracChangeset for help on using the changeset viewer.