summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorJoe7 <jozsef.rnagy@site.hu>2011-04-02 20:56:11 +0200
committerJoe7 <jozsef.rnagy@site.hu>2011-04-02 20:56:11 +0200
commitf10648fe0af7c2ae682290812cc78568aea23829 (patch)
tree6171f40b7c2a68297da084b60fe5d36625df6243 /modules
parent073650192c094080b689cd8ee202554b992223dc (diff)
Sanitize page value before setting offset based on it
Diffstat (limited to 'modules')
-rw-r--r--modules/search/controllers/search.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/search/controllers/search.php b/modules/search/controllers/search.php
index 75cbaa29..261d67ee 100644
--- a/modules/search/controllers/search.php
+++ b/modules/search/controllers/search.php
@@ -22,13 +22,14 @@ class Search_Controller extends Controller {
$page_size = module::get_var("gallery", "page_size", 9);
$q = Input::instance()->get("q");
$page = Input::instance()->get("page", 1);
- $offset = ($page - 1) * $page_size;
// Make sure that the page references a valid offset
if ($page < 1) {
$page = 1;
}
+ $offset = ($page - 1) * $page_size;
+
$q_with_more_terms = search::add_query_terms($q);
list ($count, $result) = search::search($q_with_more_terms, $page_size, $offset);