mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-31 05:57:34 +00:00
fixed limit restriction in doSearch()
This commit is contained in:
parent
b59139202d
commit
401d02daaf
|
@ -680,18 +680,17 @@ function doSearch() { /* {{{ */
|
|||
$mode = $app->request()->get('mode');
|
||||
if(!$limit = $app->request()->get('limit'))
|
||||
$limit = 8;
|
||||
$resArr = $dms->search($querystr, $limit);
|
||||
$resArr = $dms->search($querystr);
|
||||
$entries = array();
|
||||
$count = 0;
|
||||
if($resArr['folders']) {
|
||||
foreach ($resArr['folders'] as $entry) {
|
||||
if ($entry->getAccessMode($userobj) >= M_READ) {
|
||||
$entries[] = $entry;
|
||||
if($count < $limit)
|
||||
$count++;
|
||||
else
|
||||
break;
|
||||
$count++;
|
||||
}
|
||||
if($count >= $limit)
|
||||
break;
|
||||
}
|
||||
}
|
||||
$count = 0;
|
||||
|
@ -699,11 +698,10 @@ function doSearch() { /* {{{ */
|
|||
foreach ($resArr['docs'] as $entry) {
|
||||
if ($entry->getAccessMode($userobj) >= M_READ) {
|
||||
$entries[] = $entry;
|
||||
if($count < $limit)
|
||||
$count++;
|
||||
else
|
||||
break;
|
||||
$count++;
|
||||
}
|
||||
if($count >= $limit)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user