Archived
1
0

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:
Thomas Hochstein
2020-04-11 12:47:55 +02:00
parent 6522f043cf
commit 93ba22c8d4
+1 -1
View File
@@ -412,7 +412,7 @@ function &serendipity_fetchEntries($range = null, $full = true, $limit = '', $fe
// Do not allow requesting a page that doesn't exist
// 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;
}