From ec00cd1b05a958703ab82035d08981c4a277dcac Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 21 Apr 2007 21:23:47 +0000 Subject: [PATCH] - In Pagination::constructPageNav() we added the $addParam paramter to not force adding the ? or & onto the end of $baselink - Fixed "Call to undefined method BSInput::input_clean()" --- Pagination.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Pagination.php b/Pagination.php index 29ce8f8..2fe6b71 100644 --- a/Pagination.php +++ b/Pagination.php @@ -246,8 +246,8 @@ class BSPagination $input = BSRegister::LoadModule('Input'); } - $this->page = $input->input_clean($this->pagevar, TYPE_INT); - $this->perpage = $input->input_clean($this->perpagevar, TYPE_INT); + $this->page = $input->inputClean($this->pagevar, TYPE_INT); + $this->perpage = $input->inputClean($this->perpagevar, TYPE_INT); $this->pagelinks = $input->clean($this->pagelinks, TYPE_INT); if ($this->page <= 0) @@ -327,21 +327,25 @@ class BSPagination * Constructs the page navigator * * @param string Base link path + * @param bool Add a ? or a & to the path so it's link-friendly * * @return string Generated HTML page navigator */ - public function constructPageNav($baselink) + public function constructPageNav($baselink, $addParam = true) { global $bugsys; // handle base link - if (strpos($baselink, '?') === false) + if ($addParam) { - $baselink .= '?'; - } - else if (!preg_match('#\?$#', $baselink) AND !preg_match('#(&|&)$#', $baselink)) - { - $baselink .= '&'; + if (strpos($baselink, '?') === false) + { + $baselink .= '?'; + } + else if (!preg_match('#\?$#', $baselink) AND !preg_match('#(&|&)$#', $baselink)) + { + $baselink .= '&'; + } } // first page number in page nav -- 2.22.5