Changeset 1929 for trunk/gsdl/perllib/plugins
- Timestamp:
- 2001-02-08T14:21:17+13:00 (23 years ago)
- Location:
- trunk/gsdl/perllib/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/ConvertToPlug.pm
r1741 r1929 227 227 my $tmp_dirname = File::Basename::dirname($conv_filename); 228 228 my $tmp_tailname = File::Basename::basename($conv_filename); 229 229 230 230 my $convert_to = $self->{'convert_to'}; 231 231 my $ret_val; -
trunk/gsdl/perllib/plugins/HTMLPlug.pm
r1891 r1929 158 158 159 159 # trap images 160 160 161 $$textref =~ s/(<img[^>]*?src\s*=\s*\"?)([^\">\s]+)(\"?[^>]*>)/ 161 162 $self->replace_images ($1, $2, $3, $base_dir, $file, $doc_obj, $cursection)/isge; … … 174 175 my ($front, $link, $back, $base_dir, 175 176 $file, $doc_obj, $section) = @_; 176 177 177 178 $link =~ s/\n/ /g; 178 179 179 my ($href, $hash_part, $rl) = $self->format_link ($link, $base_dir, $file); 180 180 return $front . $self->add_file ($href, $rl, $hash_part, $base_dir, $doc_obj, $section) . $back; … … 235 235 $filename =~ s/^[^:]*:\/\///; 236 236 $filename = &util::filename_cat($base_dir, $filename); 237 237 238 238 my ($ext) = $filename =~ /(\.[^\.]*)$/; 239 239 … … 267 267 268 268 my ($before_hash, $hash_part) = $link =~ /^([^\#]*)(\#?.*)$/; 269 269 270 $hash_part = "" if !defined $hash_part; 270 271 if (!defined $before_hash || $before_hash !~ /[\w\.\/]/) { … … 277 278 if ($before_hash =~ s/^((?:http|ftp|file):\/\/)//i) { 278 279 my $type = $1; 279 280 280 281 if ($link =~ /^(http|ftp):/i) { 281 282 # Turn url (using /) into file name (possibly using \ on windows) … … 299 300 300 301 } elsif ($link !~ /^(mailto|news|gopher|nntp|telnet|javascript):/i) { 301 302 if ($before_hash =~ s/^\///) { 302 if ($before_hash =~ s/^\/// || $before_hash =~ /\\/) { 303 303 304 # the first directory will be the domain name if w3mir was used 304 305 # to generate archives, otherwise we'll assume all files are 305 306 # from the same site and base_dir is the root 307 # This is not called in Windows 306 308 if ($self->{'w3mir'}) { 307 309 my @dirs = split /[\/\\]/, $file; … … 314 316 # see if link shares directory with source document 315 317 # => turn into relative link if this is so! 316 my $before_hash_fix = &util::filename_cat("",$before_hash); 317 $before_hash_fix =~ s/^$base_dir(\\|\/)//; 318 my $before_hash_fix = ""; 319 320 # filename_cat appends / or \ to the beginning of the 321 # file pathname but in Windows we don't want to do that 322 if ($ENV{'GSDLOS'} =~ /^windows/i) { 323 $before_hash_fix = $before_hash; 324 } 325 else { 326 $before_hash_fix = &util::filename_cat("",$before_hash); 327 } 328 329 my $base_dir_win_match = $base_dir; 330 $base_dir_win_match =~ s/\\/\\\\/g; 331 332 $before_hash_fix =~ s/^$base_dir_win_match(\\|\/)//; 318 333 $before_hash = $before_hash_fix; 319 334 320 335 } 321 322 336 323 337 } else { … … 328 342 } 329 343 330 331 344 my $linkfilename = &util::filename_cat ($base_dir, $before_hash); 332 345 … … 335 348 $before_hash .= "/" if (-d $linkfilename); 336 349 } 337 350 338 351 return ("http://" . $before_hash, $hash_part, 1); 339 352
Note:
See TracChangeset
for help on using the changeset viewer.