Fix string equality check
The `$proto` interpolation wasn't quoted with `\Q` and `\E`, so metacharacters in `$proto` could break the matching. Switch from a regex to an expression to fix the equality check and improve readability.
This commit is contained in:
parent
61539105bd
commit
b363fb48a5
1 changed files with 2 additions and 2 deletions
|
@ -2019,8 +2019,8 @@ sub init_config {
|
|||
HOST:
|
||||
for my $h (keys %config) {
|
||||
my $proto = opt('protocol', $h);
|
||||
load_sha1_support($proto) if (grep(/^$proto$/, ("freedns", "nfsn")));
|
||||
load_json_support($proto) if (grep(/^$proto$/, ("1984", "cloudflare", "digitalocean", "gandi", "godaddy", "hetzner", "yandex", "nfsn", "njalla", "porkbun", "dnsexit2")));
|
||||
load_sha1_support($proto) if (grep($_ eq $proto, ("freedns", "nfsn")));
|
||||
load_json_support($proto) if (grep($_ eq $proto, ("1984", "cloudflare", "digitalocean", "gandi", "godaddy", "hetzner", "yandex", "nfsn", "njalla", "porkbun", "dnsexit2")));
|
||||
|
||||
if (!exists($protocols{$proto})) {
|
||||
warning("skipping host: %s: unrecognized protocol '%s'", $h, $proto);
|
||||
|
|
Loading…
Reference in a new issue