aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/indexController.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2012-10-29 18:31:05 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2012-10-29 18:31:05 +0100
commit9d801981de02d270410e589e0bb906abed95fc6f (patch)
tree265cf3617d24b9bdbf92d55eeb45d75803c36d63 /app/controllers/indexController.php
parent6c24d394916e26a91a95224a1d4cd8f22960695d (diff)
Fix bug #2
Diffstat (limited to 'app/controllers/indexController.php')
-rwxr-xr-xapp/controllers/indexController.php15
1 files changed, 11 insertions, 4 deletions
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 ();