forked from lix-project/lix
parent
f1adf4c998
commit
a8925a510c
|
@ -61,6 +61,8 @@ sub writeChannels {
|
||||||
# Adds a channel.
|
# Adds a channel.
|
||||||
sub addChannel {
|
sub addChannel {
|
||||||
my ($url, $name) = @_;
|
my ($url, $name) = @_;
|
||||||
|
die "invalid channel URL ‘$url’" unless $url =~ /^(file|http|https):\/\//;
|
||||||
|
die "invalid channel identifier ‘$name’" unless $name =~ /^[a-zA-Z0-9_][a-zA-Z0-9_\-\.]*$/;
|
||||||
readChannels;
|
readChannels;
|
||||||
$channels{$name} = $url;
|
$channels{$name} = $url;
|
||||||
writeChannels;
|
writeChannels;
|
||||||
|
|
Loading…
Reference in a new issue