Make script more intelegent. Allow ftp:// and telnet:// proto
prefixes also. This fixes "http://ftp://site.com/path/" problem.
This commit is contained in:
parent
2a132b9c7b
commit
71c0ee473b
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/www/; revision=6242
1 changed files with 13 additions and 11 deletions
|
@ -9,13 +9,15 @@
|
||||||
# where type is one of: commerical, nonprofit, personal
|
# where type is one of: commerical, nonprofit, personal
|
||||||
#
|
#
|
||||||
# yymmdd own comments
|
# yymmdd own comments
|
||||||
# ------ --- ------------------------------------------------
|
# ------ ------- ------------------------------------------------
|
||||||
# 980311 nsj First pass
|
# 980311 nsj First pass
|
||||||
# 980312 jrf Added sorting
|
# 980312 jrf Added sorting
|
||||||
# 980313 nsj Wrapped file input routine with error checking
|
# 980313 nsj Wrapped file input routine with error checking
|
||||||
# 981229 nsj Tried to be more intelligent in eliminating any
|
# 981229 nsj Tried to be more intelligent in eliminating any
|
||||||
# possible blank entries in the .db file and
|
# possible blank entries in the .db file and
|
||||||
# malformed url entries (missing http://).
|
# malformed url entries (missing http://).
|
||||||
|
# 991221 phantom Allow `ftp://' and `telnet://' as url prefixes. It allows
|
||||||
|
# to avoid "http://ftp://site" cases.
|
||||||
|
|
||||||
# Setup
|
# Setup
|
||||||
# Which sort program are we using?
|
# Which sort program are we using?
|
||||||
|
@ -64,9 +66,9 @@ while (<DBFILE>)
|
||||||
next if ($name =~ m/^$|^\s+$/);
|
next if ($name =~ m/^$|^\s+$/);
|
||||||
next if ($url =~ m/^$|^\s+$|^http:\/\/\s+$/);
|
next if ($url =~ m/^$|^\s+$|^http:\/\/\s+$/);
|
||||||
|
|
||||||
# Be semi-intelligent about entries without "http://" in front
|
# Be semi-intelligent about entries without "http://" (or "ftp://" or
|
||||||
# by prepending that to any that are missing it.
|
# "telnet://") in front by prepending that to any that are missing it.
|
||||||
$url = "http://" . $url unless ($url =~ m/^http:\/\/.*$/);
|
$url = "http://" . $url unless ($url =~ m/^(http|ftp|telnet):\/\/.*$/);
|
||||||
|
|
||||||
# Dump it out to the file, in SGML <LI> format
|
# Dump it out to the file, in SGML <LI> format
|
||||||
if ($description ne "")
|
if ($description ne "")
|
||||||
|
|
Loading…
Reference in a new issue