Fix parsing of "true" as a boolean value
Before, "t" and "ttrue" were accepted as true, but not "true". Also simplify the true and false regular expressions.
This commit is contained in:
parent
7cc36539e7
commit
40f355d05e
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.
|
||||
|
||||
### Bug fixes
|
||||
|
||||
* "true" is now accepted as a boolean value.
|
||||
|
||||
### Compatibility and dependency changes
|
||||
|
||||
* 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;
|
||||
|
||||
} elsif ($type eq T_BOOL) {
|
||||
if ($value =~ /^y(es)?$|^t(true)?$|^1$/i) {
|
||||
if ($value =~ /^(y(es)?|t(rue)?|1)$/i) {
|
||||
$value = 1;
|
||||
} elsif ($value =~ /^n(o)?$|^f(alse)?$|^0$/i) {
|
||||
} elsif ($value =~ /^(n(o)?|f(alse)?|0)$/i) {
|
||||
$value = 0;
|
||||
} else {
|
||||
return undef;
|
||||
|
|
Loading…
Reference in a new issue