diff options
author | David Phillips <david@sighup.nz> | 2018-09-21 14:10:58 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2018-09-21 14:13:28 +1200 |
commit | cfa90dc368a1ac3441185c94d287829d3985ef6d (patch) | |
tree | 7ded14e51cad7f85e5a60ec7fa8abe41d58319cc /Plugin/URL_Title.pm | |
parent | 62555509a4ced02f05f44e658abf86d7f665d63f (diff) | |
download | idalius-cfa90dc368a1ac3441185c94d287829d3985ef6d.tar.xz |
Validate configuration parameter presence and type
Diffstat (limited to 'Plugin/URL_Title.pm')
-rw-r--r-- | Plugin/URL_Title.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Plugin/URL_Title.pm b/Plugin/URL_Title.pm index 9d20cd6..e93de26 100644 --- a/Plugin/URL_Title.pm +++ b/Plugin/URL_Title.pm @@ -6,6 +6,8 @@ use HTTP::Tiny; use HTML::Parser; use utf8; +use IdaliusConfig qw/assert_scalar/; + my $config; sub configure { @@ -13,6 +15,10 @@ sub configure { my $cmdref = shift; shift; # run_command $config = shift; + + IdaliusConfig::assert_scalar($config, $self, "url_len"); + die "url_len must be positive" if $config->{url_len} <= 0; + return $self; } |