Folks:
I've just created a mod that will FIX bad URL's when they are added.
A bad URL is defined as anything that does NOT have a protocal prefix (http://, ftp://, telnet:, news:, etc).
It's added to the add.pl command in the main directory...
Here's the context that the code should be added...
# Update the counter.
open (ID, ">$db_links_id_file_name") or &cgierr("error in get_defaults. unable to open id file: $db_links_id_file_name. Reason: $!");
flock(ID, $LOCK_EX) unless (!$db_use_flock);
print ID $in{'ID'}; # update counter.
close ID; # automatically removes file lock
# David's mod start's here...
# Append http:// if there is no protocal specified on the addition.
if (!($in{'URL'} =~ /:/)) {
$in{'URL'} = "http://" . $in{'URL'};
}
# David's mod end's here...
# Print out the validate input to a "validation database" where it is stored until
# the admin decides to add it into the real database.
If you have any questions, feel free to email me.
david
I've just created a mod that will FIX bad URL's when they are added.
A bad URL is defined as anything that does NOT have a protocal prefix (http://, ftp://, telnet:, news:, etc).
It's added to the add.pl command in the main directory...
Here's the context that the code should be added...
# Update the counter.
open (ID, ">$db_links_id_file_name") or &cgierr("error in get_defaults. unable to open id file: $db_links_id_file_name. Reason: $!");
flock(ID, $LOCK_EX) unless (!$db_use_flock);
print ID $in{'ID'}; # update counter.
close ID; # automatically removes file lock
# David's mod start's here...
# Append http:// if there is no protocal specified on the addition.
if (!($in{'URL'} =~ /:/)) {
$in{'URL'} = "http://" . $in{'URL'};
}
# David's mod end's here...
# Print out the validate input to a "validation database" where it is stored until
# the admin decides to add it into the real database.
If you have any questions, feel free to email me.
david