Changeset 15604

Show
Ignore:
Timestamp:
20.05.2008 18:41:24 (11 years ago)
Author:
ak19
Message:

Change made to two locations: Corrected last commit: composition of gsdl_href by escaping backslashes before the substition and then making sure that at the end it is of a url (only forward slashes)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/plugouts/FedoraMETSPlugout.pm

    r15583 r15604  
    497497 
    498498 
    499  
    500  
    501499sub doctxt_to_xlink 
    502500{ 
     
    522520 
    523521    my $gsdl_href = "$working_dir/$fname"; 
    524      
    525     $collectparent =~ s/\\/|/g; # Temporarily replace any back slashes in the file path with |  
    526     $gsdl_href =~ s/^$collectparent(\/)?//; 
    527     $gsdl_href = "/gsdl/$gsdl_href"; 
    528     $collectparent =~ s/\|/\\/g; # Change the | in the file path back into backslashes 
    529      
     522    $collectparent =~ s/\\/\\\\/g;             # escape reserved metacharacter \ in path (by replacing it with \\) for substitution 
     523    $gsdl_href =~ s/^$collectparent(\/|\\)?//; # remove the collectparent path in gsdl_href and any trailing slash 
     524    $gsdl_href =~ s/\\/\//g;                   # make sure we have url paths (which only use / not \) 
     525    $gsdl_href = "/gsdl/$gsdl_href";           # prepend gsdl 
     526         
    530527    my $fserver = $ENV{'FEDORA_HOSTNAME'}; 
    531528    my $fport = $ENV{'FEDORA_SERVER_PORT'}; 
     
    646643 
    647644           my $gsdl_href = "$working_dir/$assfilePath"; 
    648             
    649            $gsdl_href =~ s/^$collectparent(\/)?//; 
    650            $gsdl_href = "/gsdl/$gsdl_href"; 
    651             
     645           $collectparent =~ s/\\/\\\\/g;             # escape reserved metacharacter \ in path (by replacing it with \\) for substitution 
     646           $gsdl_href =~ s/^$collectparent(\/|\\)?//; # remove the collectparent path in gsdl_href and any trailing slash 
     647           $gsdl_href =~ s/\\/\//g;                   # make sure we have url paths (which only use / not \) 
     648           $gsdl_href = "/gsdl/$gsdl_href";           # prepend gsdl 
     649                    
    652650           my $fserver = $ENV{'FEDORA_HOSTNAME'}; 
    653651           my $fport = $ENV{'FEDORA_SERVER_PORT'};