From: Nicolas LÅ“uillet Date: Thu, 3 Oct 2013 12:46:46 +0000 (+0200) Subject: bug fix #219: when archive last poched links from a page, redirect to an other page X-Git-Tag: 1.0.0~7 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=34d67c835e250c853fc8ff4230abd24ba521b878;hp=7f17a38d358bdec609a98827991108032e9257ee;p=github%2Fwallabag%2Fwallabag.git bug fix #219: when archive last poched links from a page, redirect to an other page --- diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index d6dbd19a..ffef1c3e 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -407,6 +407,12 @@ class Poche 'page_links' => '', 'nb_results' => '', ); + + # want to display a page too far? + if ((count($entries) % PAGINATION) + 1 < $_GET['p']) { + Tools::redirect(''); + } + if (count($entries) > 0) { $this->pagination->set_total(count($entries)); $page_links = $this->pagination->page_links('?view=' . $view . '&sort=' . $_SESSION['sort'] . '&');