fixed handling of empty name, not index into array but return full array

This commit is contained in:
Ralf Becker 2014-01-06 12:53:34 +00:00
parent bd505b1bf8
commit b095be7f3d
2 changed files with 6 additions and 10 deletions

View File

@ -695,7 +695,11 @@ class boetemplate extends soetemplate
}
if (is_object($idx)) return false; // given an error in php5.2
if (count($idxs = explode('[', $idx, 2)) > 1)
if (empty($idx))
{
$idxs = array();
}
elseif (count($idxs = explode('[', $idx, 2)) > 1)
{
$idxs = array_merge(array($idxs[0]), explode('][', substr($idxs[1],0,-1)));
}

View File

@ -1074,15 +1074,7 @@ class etemplate_old extends boetemplate
list($name) = explode('=',$name);
}
$form_name = self::form_name($cname,$name);
if (!is_object($name) && (string)$name !== '' && is_array($content))
{
$value = $this->get_array($content,$name);
}
else
{
$value =& $content;
}
$value = $this->get_array($content,$name);
$options = '';
if ($readonly = $cell['readonly'] && $readonlys[$name] !== false || // allow to overwrite readonly settings of a cell
@$readonlys[$name] && !is_array($readonlys[$name]) || $readonlys['__ALL__'] && (!is_string($name) || $readonlys[$name] !== false) ||