This commit is contained in:
Ad Schellevis 2016-02-23 18:42:04 +01:00
parent 036e661c89
commit 7c4bc83967
2 changed files with 6 additions and 3 deletions

View File

@ -67,7 +67,11 @@ class NetworkField extends BaseField
*/
public function setNetMaskRequired($value)
{
$this->internalNetMaskRequired = (trim(strtolower($value)) == 'y' || intval($value) == 1);
if (trim(strtoupper($value)) == "Y") {
$this->internalNetMaskRequired = true;
} else {
$this->internalNetMaskRequired = false;
}
}
/**

View File

@ -102,8 +102,7 @@ class NetworkValidator extends Validator implements ValidatorInterface
}
}
}
}
else if($this->getOption('netMaskRequired') === true) {
} elseif ($this->getOption('netMaskRequired') === true) {
$result = false;
}