Changeset 16901

Show
Ignore:
Timestamp:
19.08.2008 14:37:56 (11 years ago)
Author:
ak19
Message:

The percents in URL-encoded image filenames are only escaped with percent-25s (used in urls referring to URL-encoded filenames) if there aren't any percent-25s already in there.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/plugins/ImageConverter.pm

    r16846 r16901  
    186186    } 
    187187 
    188     # Images that will get generated may contain percent signs in their src filenames 
     188    # The images that will get generated may contain percent signs in their src filenames 
    189189    # Encode those percent signs themselves so that urls to the imgs refer to them correctly  
    190     my $url_to_filehead = $filehead;  
    191     $url_to_filehead =~ s/%/%25/g;  
     190    my $url_to_filehead = $filehead; 
     191    $url_to_filehead =~ s/%/%25/g if($url_to_filehead !~ m/%25/); 
    192192    my $url_to_filename_no_path = $filename_no_path; 
    193     $url_to_filename_no_path =~ s/%/%25/g;  
    194  
     193    $url_to_filename_no_path =~ s/%/%25/g if($url_to_filename_no_path !~ m/%25/); 
     194     
    195195    # Convert the image to a new type (if required). 
    196196    my $converttotype = $self->{'converttotype'};