Changeset 16904 for gsdl/trunk/perllib/plugins/HTMLPlugin.pm
- Timestamp:
- 2008-08-19T14:56:43+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/plugins/HTMLPlugin.pm
r16837 r16904 1109 1109 # situations. If the *original* file's name was in URL encoding, the following method will not decode it. 1110 1110 my $utf8_filename = $filename; 1111 1112 1111 # print STDERR "*** filename before URL decoding: $filename\n"; 1113 1112 $filename = $self->opt_url_decode($utf8_filename); … … 1150 1149 return "_httpdocimg_/$newname"; 1151 1150 } else { 1152 ($newname) = $utf8_filename =~ m/([^\/\\]*)$/; 1153 1151 if(&unicode::is_url_encoded($utf8_filename)) { 1152 # use the possibly-decoded filename instead to avoid double URL encoding 1153 ($newname) = $filename =~ m/([^\/\\]*)$/; 1154 } else { 1155 ($newname) = $utf8_filename =~ m/([^\/\\]*)$/; 1156 } 1154 1157 # print STDERR "Before url encoding newname: $newname\n"; 1155 1158 # Make sure this name uses only ASCII characters … … 1164 1167 # of filenames, URL-encode the additional percent signs of the URL-encoded filename 1165 1168 my $newname_url = $newname; 1166 $newname_url =~ s/%/%25/g ;1169 $newname_url =~ s/%/%25/g if $newname_url !~ m/%25/; 1167 1170 return "_httpdocimg_/$newname_url"; 1168 1171 }
Note:
See TracChangeset
for help on using the changeset viewer.