Commit 4ff89f01 authored by Nigel McNie's avatar Nigel McNie
Browse files

[PIEFORMS] Allow minvalue and maxvalue to work with much larger numbers.



intval() will fail horribly on 32 bit systems with numbers over 2GB :(
Signed-off-by: default avatarNigel McNie <nigel@catalyst.net.nz>
parent 871f638d
......@@ -34,7 +34,7 @@
* @return string The error message, if the value is invalid.
*/
function pieform_rule_maxvalue(Pieform $form, $value, $element, $maxvalue) {/*{{{*/
if ($value != '' && intval($value) > $maxvalue) {
if ($value != '' && doubleval($value) > $maxvalue) {
return sprintf($form->i18n('rule', 'maxvalue', 'maxvalue', $element), $maxvalue);
}
}/*}}}*/
......
......@@ -34,7 +34,7 @@
* @return string The error message, if the value is invalid.
*/
function pieform_rule_minvalue(Pieform $form, $value, $element, $minvalue) {/*{{{*/
if ($value != '' && intval($value) < $minvalue) {
if ($value != '' && doubleval($value) < $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