fix division by zero if all hits are shown

This commit is contained in:
Uwe Steinmann 2015-12-14 11:46:29 +01:00
parent c0fa5d9cc6
commit 1b8f515d7b

View File

@ -352,7 +352,7 @@ if(isset($_GET["fullsearch"]) && $_GET["fullsearch"]) {
$pageNumber = (int) $_GET["pg"]; $pageNumber = (int) $_GET["pg"];
} }
elseif (!strcasecmp($_GET["pg"], "all")) { elseif (!strcasecmp($_GET["pg"], "all")) {
$limit = 0; // $limit = 0;
} }
} }
@ -385,7 +385,7 @@ if(isset($_GET["fullsearch"]) && $_GET["fullsearch"]) {
$totalPages = (int) (count($entries)/$limit); $totalPages = (int) (count($entries)/$limit);
if(count($entries)%$limit) if(count($entries)%$limit)
$totalPages++; $totalPages++;
if($limit > 0) if (strcasecmp($_GET["pg"], "all"))
$entries = array_slice($entries, ($pageNumber-1)*$limit, $limit); $entries = array_slice($entries, ($pageNumber-1)*$limit, $limit);
// }}} // }}}
} }