Changeset 22689


Ignore:
Timestamp:
2010-08-19T15:57:02+12:00 (14 years ago)
Author:
mdewsnip
Message:

Trac ticket #634: change so "ftp://" is used instead of "http://" in URLs when importing mirrored content where the domain name contains "ftp". By Richard Managh at DL Consulting Ltd.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/HTMLPlugin.pm

    r22636 r22689  
    370370    my $web_url = "http://";
    371371    if(defined $dirname) { # local directory
     372        # Check for "ftp" in the domain name of the directory
     373        #  structure to determine if this URL should be a ftp:// URL
     374        # This check is not infallible, but better than omitting the
     375        #  check, which would cause all files downloaded from ftp sites
     376        #  via mirroring with wget to have potentially erroneous http:// URLs
     377        #  assigned in their metadata
     378        if ($dirname =~ /^[^\/]*ftp/i)
     379    {
     380      $web_url = "ftp://";
     381    }
    372382    $dirname = $self->eval_dir_dots($dirname);
    373383    $dirname .= &util::get_dirsep() if $dirname ne ""; # if there's a directory, it should end on "/"
Note: See TracChangeset for help on using the changeset viewer.