Commit eef6581a authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(mvc) small changes for https://github.com/opnsense/core/pull/789

(cherry picked from commit 7c4bc839)
parent c2b3c674
......@@ -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;
}
}
/**
......
......@@ -102,8 +102,7 @@ class NetworkValidator extends Validator implements ValidatorInterface
}
}
}
}
else if($this->getOption('netMaskRequired') === true) {
} elseif ($this->getOption('netMaskRequired') === true) {
$result = false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment