Don't fallback to last page if $totalPages < 1.
See #693 for context. That should at least avoid SQL errors. Signed-off-by: Thomas Hochstein <thh@inter.net>
This commit is contained in:
@@ -412,7 +412,7 @@ function &serendipity_fetchEntries($range = null, $full = true, $limit = '', $fe
|
|||||||
|
|
||||||
// Do not allow requesting a page that doesn't exist
|
// Do not allow requesting a page that doesn't exist
|
||||||
// and do a fallback to the highest page number available
|
// and do a fallback to the highest page number available
|
||||||
if ($serendipity['GET']['page'] > $totalPages) {
|
if ($totalPages > 0 && $serendipity['GET']['page'] > $totalPages) {
|
||||||
$serendipity['GET']['page'] = $totalPages;
|
$serendipity['GET']['page'] = $totalPages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user