Changeset 22689

Show
Ignore:
Timestamp:
19.08.2010 15:57:02 (9 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.

Files:
1 modified

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 "/"