Changeset 3708


Ignore:
Timestamp:
2003-01-24T17:11:53+13:00 (21 years ago)
Author:
sjboddie
Message:

Fixed a bug where HTMLPlug failed to associate files whose filenames contained spaces but
which were referred to with links where the spaces had been converted to '%20'. That is, the
file on disk may have been called "my file.gif" but HTMLPlug was looking for "my%20file.gif".
This is kind of common in HTML files created by MS Word. Note that there are many other
issues with HTML files saved from MS Word which we're not addressing (like embedded vector
graphics that die horribly after HTMLPlug removes the HTML header).

File:
1 edited

Legend:

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

    r3540 r3708  
    436436    $filename =~ s/^[^:]*:\/\///;
    437437    $filename = &util::filename_cat($base_dir, $filename);
    438    
     438       
     439    # Replace %20's in URL with a space if required. Note that the filename
     440    # may include the %20 in some situations
     441    if ($filename =~ /\%20/) {
     442    if (!-e $filename) {
     443        $filename =~ s/\%20/ /g;
     444    }
     445    }
     446
    439447    my ($ext) = $filename =~ /(\.[^\.]*)$/;
    440448
Note: See TracChangeset for help on using the changeset viewer.