Do not allow pages > 100
[phinde.git] / www / index.php
index 33adfb0ac6a20ed04ed6c635f7fe9c284ef1a10a..7c4904b4d45a6cac241fd0564d5535df8c213a85 100644 (file)
@@ -15,6 +15,12 @@ if (isset($_GET['page'])) {
     }
     //PEAR Pager begins at 1
     $page = (int)$_GET['page'] - 1;
+
+    if ($page >= 100) {
+        //Elasticsearch by default only allows 100 pages
+        // we do not want exceptions in our logs
+        throw new Exception_Input('List page is too large');
+    }
 }
 
 $perPage = 10;//$GLOBALS['phinde']['perPage'];
@@ -98,7 +104,7 @@ $timeEnd = microtime(true);
 
 $pager = new Html_Pager(
     $res->hits->total, $perPage, $page + 1,
-    $baseLink
+    buildLink($baseLink, $filters, null, null)
 );
 
 foreach ($res->hits->hits as &$hit) {