Changeset 16632 for gsdl/trunk/perllib/plugins/HTMLPlugin.pm
- Timestamp:
- 2008-08-01T15:42:09+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/plugins/HTMLPlugin.pm
r16392 r16632 937 937 $link =~ s/^.*\\([^\\]+)$/$1/; 938 938 } 939 939 940 940 my ($href, $hash_part, $rl) = $self->format_link ($link, $base_dir, $file); 941 941 942 942 my $img_file = $self->add_file ($href, $rl, $hash_part, $base_dir, $doc_obj, $section); 943 944 print STDERR "**** link = $link\n"; 945 print STDERR "**** href = $href\n"; 946 print STDERR "**** img_file = $img_file\n"; 943 947 944 948 my $anchor_name = $img_file; … … 1020 1024 $filename = &util::filename_cat($base_dir, $filename); 1021 1025 1022 # Replace % 20's in URL with a space if required. Note that the filename1023 # may include the %20in some situations1024 if ($filename =~ /\%20/) {1026 # Replace %XX's in URL with decoded value if required. 1027 # Note that the filename may include the %XX in some situations 1028 if ($filename =~ m/\%[A-F0-9]{2}/i) { 1025 1029 if (!-e $filename) { 1026 $filename =~ s/\% 20/ /g;1030 $filename =~ s/\%([A-F0-9]{2})/pack('C', hex($1))/ige; 1027 1031 } 1028 1032 } … … 1055 1059 } else { 1056 1060 ($newname) = $filename =~ /([^\/\\]*)$/; 1061 # Make sure this name is a valid utf8 filename 1062 ## &unicode::ensure_utf8(\$newname); 1063 $newname =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg; 1064 1057 1065 $doc_obj->associate_file($filename, $newname, undef, $section); 1058 return "_httpdocimg_/$newname"; 1059 } 1060 } 1066 1067 my $newname_url = $newname; 1068 $newname_url =~ s/%/%25/g; 1069 return "_httpdocimg_/$newname_url"; 1070 } 1071 } 1072 1061 1073 1062 1074
Note:
See TracChangeset
for help on using the changeset viewer.