Changeset 16935

Show
Ignore:
Timestamp:
21.08.2008 11:53:55 (11 years ago)
Author:
ak19
Message:

Removed the commented out debug statements now, since I think url-encoding/handling of multilingual files is done for this file.

Files:
1 modified

Legend:

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

    r16920 r16935  
    619619    my $utf8_link = ""; 
    620620    $self->decode_text($link,$encoding,$language,\$utf8_link); 
    621 ### my $utf8_url_encoded_link = &unicode::url_encode($utf8_link); 
    622621 
    623622    $self->{'utf8_to_original_filename'}->{$utf8_link} = $url_original_filename; 
    624 ### $self->{'utf8_to_original_filename'}->{$utf8_url_encoded_link} = $url_original_filename; 
    625  
    626 #   print STDERR "**** Storing block link: $link\n"; 
    627 #   print STDERR "**** URL original filename: $url_original_filename\n"; 
    628     print STDERR "**** utf8_encoded_link to original src filename:\n\t$utf8_link\n\t".$self->{'utf8_to_original_filename'}->{$utf8_link}."\n"; 
     623#   print STDERR "**** utf8_encoded_link to original src filename:\n\t$utf8_link\n\t".$self->{'utf8_to_original_filename'}->{$utf8_link}."\n"; 
    629624 
    630625    $block_hash->{'file_blocks'}->{$url_original_filename} = 1; 
     
    707702    # links, so even if 'file_is_url' is off, still need to store info 
    708703 
    709 #    print STDERR "#### file: $file\n"; 
    710  
    711704    my ($tailname,$dirname,$suffix) = &File::Basename::fileparse($file, "\\.[^\\.]+\$"); 
    712705    my $utf8_file = $self->filename_to_utf8_metadata($file); 
     
    719712    $web_url = $web_url.$utf8_file; 
    720713    } 
    721 #    print STDERR "#### weburl: $web_url\n"; 
    722714 
    723715    $doc_obj->add_utf8_metadata($cursection, "URL", $web_url); 
     
    1004996    my $img_file =  $self->add_file ($href, $rl, $hash_part, $base_dir, $doc_obj, $section); 
    1005997 
    1006 #    print STDERR "**** link = $link\n"; 
    1007 #    print STDERR "**** href = $href\n"; 
    1008 #    print STDERR "**** img_file = $img_file\n"; 
     998#    print STDERR "**** link = $link\n**** href = $href\n**** img_file = $img_file\n"; 
    1009999 
    10101000    my $anchor_name = $img_file; 
     
    10501040    # This is more complicated than it sounds when char encodings 
    10511041    # is taken in to account 
    1052 ##    &unicode::ensure_utf8(\$link); 
    1053 ##    $link = &unicode::url_encode($link); 
    1054 #    print STDERR "#### filepath: ".&util::filename_cat($base_dir,$file)."\n"; 
    1055 #    print STDERR "#### link: $link\n"; 
    1056  
    10571042    my ($href, $hash_part, $rl) = $self->format_link ($link, $base_dir, $file); 
    1058 #    print STDERR "#### href: $href\n"; 
    10591043  
    10601044    # href may use '\'s where '/'s should be on Windows 
    10611045    $href =~ s/\\/\//g; 
    1062  
    1063 ##    $href = &unicode::url_decode($href); 
    1064 #    print STDERR "#### href again: $href\n"; 
    10651046    my ($filename) = $href =~ m/^(?:.*?):(?:\/\/)?(.*)/; 
    10661047     
     
    11051086 
    11061087    $filename = &util::filename_cat($base_dir, $filename); 
    1107 #    print STDERR "**** filename: $filename\n"; 
    11081088    # Replace %XX's in URL with decoded value if required. Note that the filename may include the %XX in some 
    11091089    # situations. If the *original* file's name was in URL encoding, the following method will not decode it. 
    11101090    my $utf8_filename = $filename; 
    1111 #    print STDERR "*** filename before URL decoding: $filename\n"; 
    11121091    $filename = $self->opt_url_decode($utf8_filename); 
    1113 #    print STDERR "*** filename after URL decoding:  $filename\n\n"; 
    11141092 
    11151093    # some special processing if the intended filename was converted to utf8, but 
     
    11181096    # try the original filename stored in map 
    11191097    my $original_filename = $self->{'utf8_to_original_filename'}->{$filename}; 
    1120 #   print STDERR "*** missing: $filename" unless defined $original_filename; #StrangeNoGraphicData in word doc 
    11211098    if (defined $original_filename && -e $original_filename) { 
    11221099        $filename = $original_filename; 
     
    11561133        ($newname) = $utf8_filename =~ m/([^\/\\]*)$/; 
    11571134    } 
    1158 #   print STDERR "Before url encoding newname: $newname\n"; 
     1135 
    11591136    # Make sure this name uses only ASCII characters  
    11601137    # => use URL encoding, as it preserves original encoding 
    11611138    $newname = &unicode::url_encode($newname); 
    1162 #   print STDERR "After url encoding newname: $newname\n"; 
    1163 #   print STDERR "*** Real name and converted filename:\n\t$filename\n\t$newname\n"; 
    11641139 
    11651140    $doc_obj->associate_file($filename, $newname, undef, $section); 
     
    12531228        $before_hash = &util::filename_cat($dirname, $before_hash); 
    12541229        $before_hash = $self->eval_dir_dots($before_hash);               
    1255          
    1256 #       print STDERR "#### before_hash: $before_hash\n"; 
    12571230    } 
    12581231