From 9d801981de02d270410e589e0bb906abed95fc6f Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Mon, 29 Oct 2012 18:31:05 +0100 Subject: Fix bug #2 --- app/controllers/indexController.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'app/controllers/indexController.php') diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php index a4e81ab90..315e301ad 100755 --- a/app/controllers/indexController.php +++ b/app/controllers/indexController.php @@ -40,10 +40,17 @@ class indexController extends ActionController { } // Gestion pagination - $page = Request::param ('page', 1); - $this->view->entryPaginator = new Paginator ($entries); - $this->view->entryPaginator->_nbItemsPerPage ($this->view->conf->postsPerPage ()); - $this->view->entryPaginator->_currentPage ($page); + try { + $page = Request::param ('page', 1); + $this->view->entryPaginator = new Paginator ($entries); + $this->view->entryPaginator->_nbItemsPerPage ($this->view->conf->postsPerPage ()); + $this->view->entryPaginator->_currentPage ($page); + } catch (CurrentPagePaginationException $e) { + Error::error ( + 404, + array ('error' => array ('La page que vous cherchez n\'existe pas')) + ); + } $this->view->cat_aside = $catDAO->listCategories (); $this->view->nb_favorites = $entryDAO->countFavorites (); -- cgit v1.2.3