mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-28 10:53:39 +01:00
validating (string) === '' (instead === ''), as on ajax commit no yet set inputs are returned as null instead of ''
This commit is contained in:
parent
7f02626fe6
commit
b291c0fa5f
@ -2124,7 +2124,7 @@ class etemplate extends boetemplate
|
|||||||
case 'text':
|
case 'text':
|
||||||
case 'textarea':
|
case 'textarea':
|
||||||
case 'colorpicker':
|
case 'colorpicker':
|
||||||
if ($value === '' && $attr['needed'] && !$attr['blur'])
|
if ((string)$value === '' && $attr['needed'] && !$attr['blur'])
|
||||||
{
|
{
|
||||||
self::set_validation_error($form_name,lang('Field must not be empty !!!'),'');
|
self::set_validation_error($form_name,lang('Field must not be empty !!!'),'');
|
||||||
}
|
}
|
||||||
@ -2149,7 +2149,7 @@ class etemplate extends boetemplate
|
|||||||
}
|
}
|
||||||
elseif ($type == 'int' || $type == 'float') // cast int and float and check range
|
elseif ($type == 'int' || $type == 'float') // cast int and float and check range
|
||||||
{
|
{
|
||||||
if ($value !== '' || $attr['needed']) // empty values are Ok if needed is not set
|
if ((string)$value !== '' || $attr['needed']) // empty values are Ok if needed is not set
|
||||||
{
|
{
|
||||||
$value = $type == 'int' ? (int) $value : (float) str_replace(',','.',$value); // allow for german (and maybe other) format
|
$value = $type == 'int' ? (int) $value : (float) str_replace(',','.',$value); // allow for german (and maybe other) format
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user