Do not allow pages > 100
[phinde.git] / www / index.php
index 8bd900ca90f403889957547cbd223bc14c5e0efe..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) {
@@ -175,6 +181,7 @@ render(
         'sort' => $sort,
         'urlSorts' => $urlSorts,
         'hitTemplate' => 'search/' . $GLOBALS['phinde']['hitTemplate'],
+        'sidebarinclude' => $GLOBALS['phinde']['sidebarinclude'],
     )
 );
 ?>