Ignore:
Timestamp:
2009-01-06T19:03:58+13:00 (15 years ago)
Author:
ak19
Message:

Now plugins provide the option of base64 encoding or url encoding filenames that are to be renamed (when copied into the archives dir). Previously renamed files would always be url-encoded. URL-encoding is the default now for most plugins except MP3Plugin and OggVorbisPlugin, where the default is base64 encoding. Base64 encoding filenames upon renaming them was introduced so that more files that browsers try to open in external applications can open them, since url encoding does not seem to be implemented the same everywhere (for instance, windows media player is unable to handle url-encoded wmv filenames when such files are launched in it through the browser).

File:
1 edited

Legend:

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

    r18135 r18320  
    635635# Given a filename in any encoding, will URL decode it to get back the original filename
    636636# in the original encoding. Because this method is intended to work out the *original*
    637 # filename*, it not URL decode any filename if a file by the name of the *URL-encoded*
     637# filename*, it does not URL decode any filename if a file by the name of the *URL-encoded*
    638638# string already exists in the local folder.
    639639# Return the original filename corresponding to the parameter URL-encoded filename, and
     
    11401140    }
    11411141
    1142     # Make sure this name uses only ASCII characters
    1143     # => use URL encoding, as it preserves original encoding
    1144     $newname = &unicode::url_encode($newname);
     1142    # Make sure this name uses only ASCII characters.
     1143    # We use either base64 or URL encoding, as these preserve original encoding
     1144    $newname = &util::rename_file($newname, $self->{'file_rename_method'});
    11451145
    11461146    $doc_obj->associate_file($filename, $newname, undef, $section);
Note: See TracChangeset for help on using the changeset viewer.