Ignore:
Timestamp:
2008-06-03T16:02:04+12:00 (16 years ago)
Author:
ak19
Message:

Filename metadata is turned into utf8 and then added to the document using add_utf8_metadata as opposed to add_metadata which assumed the filename was in ASCII and converted it. The old version used to cause relative links to be perceived as external links when the links referred to html pages with foreign-language characters.

File:
1 edited

Legend:

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

    r15838 r15841  
    669669    # URL metadata (even invalid ones) are used to support internal
    670670    # links, so even if 'file_is_url' is off, still need to store info
    671 
     671   
     672    $file = &BasPlug::filename_to_metadata($self, $file); # ensures filename is in UTF8 character encoding
    672673    my $web_url = "http://$file";
    673     $doc_obj->add_metadata($cursection, "URL", $web_url);
     674    $doc_obj->add_utf8_metadata($cursection, "URL", $web_url); # will eventually ensure it is utf8 anyway
    674675
    675676    if ($self->{'file_is_url'}) {
     
    10731074
    10741075    my ($before_hash, $hash_part) = $link =~ /^([^\#]*)(\#?.*)$/;
    1075    
     1076
    10761077    $hash_part = "" if !defined $hash_part;
    10771078    if (!defined $before_hash || $before_hash !~ /[\w\.\/]/) {
Note: See TracChangeset for help on using the changeset viewer.