Marien Fressinaud %!s(int64=13) %!d(string=hai) anos
pai
achega
9d801981de
Modificáronse 1 ficheiros con 11 adicións e 4 borrados
  1. 11 4
      app/controllers/indexController.php

+ 11 - 4
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 ();