Commit dc706458 authored by Robert Lyon's avatar Robert Lyon
Browse files

Fixing type checking on min/max values (Bug #1394732)



Change-Id: I042c1127f7601483e8723b2e31bf07683accf2c0
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent b8abf335
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
* @return string The error message, if the value is invalid. * @return string The error message, if the value is invalid.
*/ */
function pieform_rule_maxvalue(Pieform $form, $value, $element, $maxvalue) {/*{{{*/ function pieform_rule_maxvalue(Pieform $form, $value, $element, $maxvalue) {/*{{{*/
if ($value != '' && doubleval($value) > $maxvalue) { if ($value !== '' && doubleval($value) > $maxvalue) {
return sprintf($form->i18n('rule', 'maxvalue', 'maxvalue', $element), $maxvalue); return sprintf($form->i18n('rule', 'maxvalue', 'maxvalue', $element), $maxvalue);
} }
}/*}}}*/ }/*}}}*/
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
* @return string The error message, if the value is invalid. * @return string The error message, if the value is invalid.
*/ */
function pieform_rule_minvalue(Pieform $form, $value, $element, $minvalue) {/*{{{*/ function pieform_rule_minvalue(Pieform $form, $value, $element, $minvalue) {/*{{{*/
if ($value != '' && doubleval($value) < $minvalue) { if ($value !== '' && doubleval($value) < $minvalue) {
return sprintf($form->i18n('rule', 'minvalue', 'minvalue', $element), $minvalue); return sprintf($form->i18n('rule', 'minvalue', 'minvalue', $element), $minvalue);
} }
}/*}}}*/ }/*}}}*/
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