Fixed pagination when searching terms with fetchlimit < 4
This commit is contained in:
@@ -882,8 +882,15 @@ function &serendipity_searchEntries($term, $limit = '', $searchresults = '') {
|
||||
if ($p == 1 && strpos($term, '*') === false && $serendipity['dbType'] != 'sqlite' && $serendipity['dbType'] != 'sqlite3' && $serendipity['dbType'] != 'pdo-sqlite') {
|
||||
if (! is_array($search)) {
|
||||
return serendipity_searchEntries($term.'*', $orig_limit);
|
||||
}else if (count($search) < 4){
|
||||
return serendipity_searchEntries($term.'*', $orig_limit, $search);
|
||||
} else {
|
||||
$ec = count($search);
|
||||
$checkcount = 4;
|
||||
if ($serendipity['fetchLimit'] < $checkcount) {
|
||||
$checkcount = $serendipity['fetchLimit'];
|
||||
}
|
||||
if ($ec < $checkcount) {
|
||||
return serendipity_searchEntries($term.'*', $orig_limit, $search);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user