fixed empty resultset if num_rows option is not defined, removed some weird indents

This commit is contained in:
Christian Binder 2009-12-16 13:10:55 +00:00
parent b48c4f51fc
commit 86346deefe

View File

@ -583,9 +583,9 @@ class egw_link extends solink
{ {
$options['total'] = count($result); $options['total'] = count($result);
} }
if (is_array($result) && (isset($options['start']) || count($result) > $options['num_rows'])) if (is_array($result) && (isset($options['start']) || (isset($options['num_rows']) && count($result) > $options['num_rows'])))
{ {
$result = array_slice($result, $options['start'], $options['num_rows'], true); $result = array_slice($result, $options['start'], (isset($options['num_rows']) ? $options['num_rows'] : count($result)), true);
} }
return $result; return $result;