Merge pull request #183 from rhansen/bool-parsing
Fix parsing of "true" as a boolean value
This commit is contained in:
commit
2f26ed5969
2 changed files with 6 additions and 2 deletions
|
@ -9,6 +9,10 @@ repository history](https://github.com/ddclient/ddclient/commits/master).
|
||||||
|
|
||||||
* Added support for OVH DynHost.
|
* Added support for OVH DynHost.
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
* "true" is now accepted as a boolean value.
|
||||||
|
|
||||||
### Compatibility and dependency changes
|
### Compatibility and dependency changes
|
||||||
|
|
||||||
* Perl v5.10.1 or later is now required.
|
* Perl v5.10.1 or later is now required.
|
||||||
|
|
4
ddclient
4
ddclient
|
@ -1864,9 +1864,9 @@ sub check_value {
|
||||||
$value = $min if defined($min) && $value < $min;
|
$value = $min if defined($min) && $value < $min;
|
||||||
|
|
||||||
} elsif ($type eq T_BOOL) {
|
} elsif ($type eq T_BOOL) {
|
||||||
if ($value =~ /^y(es)?$|^t(true)?$|^1$/i) {
|
if ($value =~ /^(y(es)?|t(rue)?|1)$/i) {
|
||||||
$value = 1;
|
$value = 1;
|
||||||
} elsif ($value =~ /^n(o)?$|^f(alse)?$|^0$/i) {
|
} elsif ($value =~ /^(n(o)?|f(alse)?|0)$/i) {
|
||||||
$value = 0;
|
$value = 0;
|
||||||
} else {
|
} else {
|
||||||
return undef;
|
return undef;
|
||||||
|
|
Loading…
Reference in a new issue