Fix problem with false/0 values failing validation

This commit is contained in:
Nathan Gray 2013-04-02 22:57:09 +00:00
parent 70126e5698
commit b9a43091dc

View File

@ -97,6 +97,10 @@ class etemplate_widget_menupopup extends etemplate_widget
}
foreach((array) $value as $val)
{
// array_key_exists() (used below) is inconsistent in how it handles empty/false
// It needs a string or integer.
if(!$val && $val !== 0) $val = '';
// Special for select-account - selOptions doesn't always load all accounts
if($this->attrs['type'] == 'select-account' && !$GLOBALS['egw']->accounts->visible($val) && !isset($allowed[$val]) ||
$this->attrs['type'] != 'select-account' && !array_key_exists($val,$allowed))