mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 00:58:55 +01:00
fix server-side validation to allow values of option children
This commit is contained in:
parent
d8cf78d045
commit
9a57fbaedd
@ -137,10 +137,16 @@ class Select extends Etemplate\Widget
|
||||
|
||||
$allowed2 = self::selOptions($form_name, true); // true = return array of option-values
|
||||
$type_options = self::typeOptions($this,
|
||||
// typeOptions thinks # of rows is the first thing in options
|
||||
($this->attrs['rows'] && strpos($this->attrs['options'], $this->attrs['rows']) !== 0 ? $this->attrs['rows'].','.$this->attrs['options'] : $this->attrs['options']));
|
||||
// typeOptions thinks # of rows is the first thing in options
|
||||
($this->attrs['rows'] && strpos($this->attrs['options'], $this->attrs['rows']) !== 0 ? $this->attrs['rows'].','.$this->attrs['options'] : $this->attrs['options']));
|
||||
$allowed = array_merge($allowed2,array_keys($type_options));
|
||||
|
||||
// add option children's values too, "" is not read, therefore we cast to string
|
||||
foreach($this->children as $child)
|
||||
{
|
||||
if ($child->type == 'option') $allowed[] = (string)$child->attrs['value'];
|
||||
}
|
||||
|
||||
if (!$this->attrs['multiple'] || !($this->attrs['options'] > 1)) $allowed[] = '';
|
||||
|
||||
foreach((array) $value as $val)
|
||||
|
Loading…
Reference in New Issue
Block a user