Changeset 20413
- Timestamp:
- 2009-08-28T09:57:18+12:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/util.pm
r19762 r20413 1030 1030 # Returns the given filename converted using either URL encoding or base64 1031 1031 # encoding, as specified by $rename_method. If the given filename has no suffix 1032 # (if it is just the tailname), then $no_suffix should be some defined value. 1032 # (if it is just the tailname), then $no_suffix should be some defined value. 1033 # rename_method can be url, none, base64 1033 1034 sub rename_file { 1034 1035 my ($filename, $rename_method, $no_suffix) = @_; … … 1036 1037 if(!$filename) { # undefined or empty string 1037 1038 return $filename; 1039 } 1040 1041 if (!$rename_method) { 1042 print STDERR "WARNING: no file renaming method specified. Defaulting to using URL encoding...\n"; 1043 # Debugging information 1044 my ($cpackage,$cfilename,$cline,$csubr,$chas_args,$cwantarray) = caller(1); 1045 print STDERR "Called from method: $cfilename:$cline $cpackage->$csubr\n"; 1046 $rename_method = "url"; 1047 } elsif($rename_method eq "none") { 1048 return $filename; # would have already been renamed 1038 1049 } 1039 1050 … … 1051 1062 $suffix = "" if !$suffix; 1052 1063 1053 if (!$rename_method) { 1054 print STDERR "WARNING: no file renaming method specified. Defaulting to using URL encoding...\n"; 1055 # Debugging information 1056 my ($cpackage,$cfilename,$cline,$csubr,$chas_args,$cwantarray) = caller(1); 1057 print STDERR "Calling method: $cfilename:$cline $cpackage->$csubr\n"; 1058 } elsif($rename_method eq "none") { 1059 return $filename; # would have already been renamed 1060 } 1061 1062 if (!$rename_method || $rename_method eq "url") { 1064 if ($rename_method eq "url") { 1063 1065 $tailname = &unicode::url_encode($tailname); 1064 1066 }
Note:
See TracChangeset
for help on using the changeset viewer.