Changeset 27703 for main/trunk
- Timestamp:
- 2013-06-25T16:36:58+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/HTMLPlugin.pm
r27306 r27703 796 796 my $img_file = $self->add_file ($href, $rl, $hash_part, $base_dir, $doc_obj, $section); 797 797 798 # print STDERR "**** link = $link\n**** href = $href\n**** img_file = $img_file, rl = $rl\n ";798 # print STDERR "**** link = $link\n**** href = $href\n**** img_file = $img_file, rl = $rl\n\n"; 799 799 800 800 my $anchor_name = $img_file; … … 980 980 $filename =~ s/^[^:]*:\/\///; 981 981 } 982 982 983 if ($ENV{'GSDLOS'} =~ m/^windows$/i) { 984 $filename =~ s@\/@\\@g; 985 } 986 983 987 $filename = &FileUtils::filenameConcatenate($base_dir, $filename); 984 988 … … 1129 1133 if ($before_hash =~ s@^((?:http|https|ftp|file|mms)://)@@i) { 1130 1134 my $type = $1; 1131 1135 my $before_hash_file = $before_hash; 1136 1132 1137 if ($link =~ m/^(http|ftp):/i) { 1138 1133 1139 # Turn url (using /) into file name (possibly using \ on windows) 1134 my @http_dir_split = split('/', $before_hash); 1135 $before_hash = &FileUtils::filenameConcatenate(@http_dir_split); 1136 } 1137 1138 $before_hash = $self->eval_dir_dots($before_hash); 1139 1140 my $linkfilename = &FileUtils::filenameConcatenate($base_dir, $before_hash); 1140 my @http_dir_split = split('/', $before_hash_file); 1141 $before_hash_file = &FileUtils::filenameConcatenate(@http_dir_split); 1142 } 1143 1144 # want to maintain two version of "before_hash": one representing the URL, the other using filesystem specific directory separator 1145 $before_hash_file = $self->eval_dir_dots($before_hash_file); 1146 my $before_hash_url = $before_hash_file; 1147 if ($ENV{'GSDLOS'} =~ /^windows$/i) { 1148 $before_hash_url =~ s@\\@\/@g; 1149 } 1150 1151 my $linkfilename = &FileUtils::filenameConcatenate($base_dir, $before_hash_file); 1141 1152 1142 1153 my $rl = 0; … … 1144 1155 1145 1156 # make sure there's a slash on the end if it's a directory 1146 if ($before_hash !~ m/\/$/) {1147 $before_hash .= "/" if (-d $linkfilename);1148 } 1149 return ($type . $before_hash , $hash_part, $rl);1157 if ($before_hash_url !~ m/\/$/) { 1158 $before_hash_url .= "/" if (-d $linkfilename); 1159 } 1160 return ($type . $before_hash_url, $hash_part, $rl); 1150 1161 1151 1162 } elsif ($link !~ m/^(mailto|news|gopher|nntp|telnet|javascript):/i && $link !~ m/^\//) { … … 1191 1202 my $dirname = &File::Basename::dirname($file); 1192 1203 $before_hash = &FileUtils::filenameConcatenate($dirname, $before_hash); 1193 $before_hash = $self->eval_dir_dots($before_hash); 1204 $before_hash = $self->eval_dir_dots($before_hash); 1205 $before_hash =~ s@\\@/@g; # for windows 1194 1206 } 1195 1207
Note:
See TracChangeset
for help on using the changeset viewer.