git.cweiske.de
/
phorkie.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
FIX: Revamped security measures
[phorkie.git]
/
www
/
search.php
diff --git
a/www/search.php
b/www/search.php
index aef209f2ebdd82721c25aa999601c9eff229f050..2621382e3d6c3a1d132b2918d2f94b4065db990e 100644
(file)
--- a/
www/search.php
+++ b/
www/search.php
@@
-3,6
+3,7
@@
namespace phorkie;
/**
* Search for a search term
*/
/**
* Search for a search term
*/
+$pageRequiresLogin = '0';
require_once 'www-header.php';
if (!isset($_GET['q']) || $_GET['q'] == '') {
require_once 'www-header.php';
if (!isset($_GET['q']) || $_GET['q'] == '') {
@@
-16,7
+17,8
@@
if (isset($_GET['page'])) {
if (!is_numeric($_GET['page'])) {
throw new Exception_Input('List page is not numeric');
}
if (!is_numeric($_GET['page'])) {
throw new Exception_Input('List page is not numeric');
}
- $page = (int)$_GET['page'];
+ //PEAR Pager begins at 1
+ $page = (int)$_GET['page'] - 1;
}
$perPage = 10;
}
$perPage = 10;
@@
-24,11
+26,16
@@
$db = new Database();
$search = $db->getSearch();
$sres = $search->search($query, $page, $perPage);
$search = $db->getSearch();
$sres = $search->search($query, $page, $perPage);
+
+$pager = new Html_Pager(
+ $sres->getResults(), $perPage, $page + 1, $sres->getLink($query)
+);
render(
'search',
array(
'query' => $query,
'sres' => $sres,
render(
'search',
array(
'query' => $query,
'sres' => $sres,
+ 'pager' => $pager
)
);
?>
)
);
?>