Changeset 22471

Show
Ignore:
Timestamp:
21.07.2010 17:22:18 (10 years ago)
Author:
ak19
Message:

Changes to get collectgroup working with a Remote Greenstone server on Windows: get script options is to launch a script with arguments, one of which is the collection again, which can be a collectgroup. GLI passes the collection name in with a verticalbar separating the colgroup from the coltailname. The safe_val method called on the arguments to the script doesn't preserve backslashes and vertical bars, so the vertical bar is first replaced with a forward slash, then the safe_val method is called before the forward slash is replaced with the OS's File separator slash.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/cgi-bin/gliserver.pl

    r22453 r22471  
    1 #!/usr/bin/perl -w 
     1#!C:\Perl\bin\perl -w 
    22# Need to specify the full path of Perl above 
    33 
     
    818818    foreach my $cgi_arg_name ($gsdl_cgi->param) { 
    819819    my $cgi_arg_value = $gsdl_cgi->clean_param($cgi_arg_name) || ""; 
     820     
     821    # When get_script_options is to launch classinfo.pl or pluginfo.pl, one of the args to be passed to the script 
     822    # is the collection name. This may be a (collectgroup/)coltailname coming in here as (collectgroup|)coltailname. 
     823    # Since calling safe_val() below on the collection name value will get rid of \ and |, but preserves /, need to 
     824    # first replace the | with /, then run safe_val, then convert the / to the OS dependent File separator. 
     825    $cgi_arg_value =~ s@\|@\/@g if ($cgi_arg_name =~ m/^collection/); 
    820826    $cgi_arg_value = $gsdl_cgi->safe_val($cgi_arg_value); 
     827    $cgi_arg_value =~ s@\/@&util::get_dirsep()@eg if($cgi_arg_name =~ m/^collection/); 
    821828    if ($cgi_arg_value eq "") { 
    822829        $perl_args = "-$cgi_arg_name " . $perl_args;