]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
bug fix #219: when archive last poched links from a page, redirect to an other page
authorNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Thu, 3 Oct 2013 12:46:46 +0000 (14:46 +0200)
committerNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Thu, 3 Oct 2013 12:46:46 +0000 (14:46 +0200)
inc/poche/Poche.class.php

index d6dbd19a41832cb97db47565748413131d0c62f4..ffef1c3eea5fa9fccb9fe869bdd6baa6da0dfa7a 100644 (file)
@@ -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'] . '&');