diff --git a/etemplate/inc/class.xul_io.inc.php b/etemplate/inc/class.xul_io.inc.php index 606cf17144..2169397a56 100644 --- a/etemplate/inc/class.xul_io.inc.php +++ b/etemplate/inc/class.xul_io.inc.php @@ -120,6 +120,14 @@ class xul_io 'menupopup' => 'select', 'description' => 'label' ); + + /** + * explicit whitelist for certain attributes and widget types + */ + var $attr_whitelist = array( + 'rows' => array('textbox'), + 'cols' => array('textbox'), + ); /** * Keys of currently processed template on export, to resolve relative names * @@ -275,7 +283,7 @@ class xul_io } // no sure where the data key gets set, but it gives a warning in xml serialization (empty array) unset($cell['data']); - $cell['orient'] = $orient; + if (!empty($orient)) $cell['orient'] = $orient; $cell['size'] = $options; break; @@ -309,6 +317,11 @@ class xul_io { $attr = $this->attr2xul[$attr]; } + // check if attribute has an explicit whitelist and widget type is in it + if (isset($this->attr_whitelist[$attr]) && !in_array($type, $this->attr_whitelist[$attr])) + { + continue; + } $this->set_attributes($attr_widget,$attr,$val); } if ($child)