[eGroupWare-svn] r55797 - /trunk/egroupware/api/src/Etemplate/Widget/Select.php

[email protected]
Newsgroups gmane.comp.web.egroupware.cvs
Message-ID <[email protected]>
Author: ralfbecker
Date: Thu Apr 21 16:51:40 2016
New Revision: 55797

URL: http://svn.stylite.de/viewvc/egroupware?rev=55797&view=rev
Log:
fix server-side validation to allow values of option children

Modified:
    trunk/egroupware/api/src/Etemplate/Widget/Select.php

Modified: trunk/egroupware/api/src/Etemplate/Widget/Select.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/src/Etemplate/Widget/Select.php?rev=55797&r1=55796&r2=55797&view=diff
==============================================================================
--- trunk/egroupware/api/src/Etemplate/Widget/Select.php (original)
+++ trunk/egroupware/api/src/Etemplate/Widget/Select.php Thu Apr 21 16:51:40 2016
@@ -137,9 +137,15 @@
 
 			$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[] = '';
 


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.