Changeset 16799

Show
Ignore:
Timestamp:
14.08.2008 20:18:50 (11 years ago)
Author:
ak19
Message:

URL encoding href links for internal links since the database lookup has trouble with keys that are UTF8

Files:
1 modified

Legend:

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

    r16769 r16799  
    710710    my ($tailname,$dirname,$suffix) = &File::Basename::fileparse($file, "\\.[^\\.]+\$"); 
    711711    my $utf8_file = $self->filename_to_utf8_metadata($file); 
    712 #    $utf8_file = &unicode::url_encode($utf8_file); 
    713712 
    714713    my $web_url = "http://"; 
     
    718717    $web_url = $web_url.$utf8_file; 
    719718    } 
     719    # URL encode this in unison with web_url since database lookup via Java code does not handle utf8-encoded keys 
     720    $web_url = &unicode::url_encode($web_url); 
    720721#    print STDERR "#### weburl: $web_url\n"; 
    721722 
     
    10791080    if (($rl == 0) || ($filename =~ m/$self->{'process_exp'}/) ||  
    10801081    ($href =~ m/\/$/) || ($href =~ m/^(mailto|news|gopher|nntp|telnet|javascript):/i)) { 
    1081     &ghtml::urlsafe ($href); 
     1082    # URL encode this in unison with web_url since database lookup via Java code does not handle utf8-encoded keys 
     1083    # No longer need to &ghtml::urlsafe($href) for special characters, since the entire thing is going to be URL-encoded 
     1084    $href = &unicode::url_encode($href); 
    10821085    return $front . "_httpextlink_&rl=" . $rl . "&href=" . $href . $hash_part . $back; 
    10831086    } else {