Merge pull request #1366 from ddorian1/release-3.3.3
fix urls for pager
This commit is contained in:
commit
df6188f2c7
1 changed files with 5 additions and 5 deletions
|
@ -276,17 +276,17 @@ function paginate_data(&$a, $count=null) {
|
||||||
$stripped = trim($stripped,'/');
|
$stripped = trim($stripped,'/');
|
||||||
$pagenum = $a->pager['page'];
|
$pagenum = $a->pager['page'];
|
||||||
|
|
||||||
if (($a->page_offset != "") AND !strstr($stripped, "&offset="))
|
if (($a->page_offset != "") AND !preg_match('/[?&].offset=/', $stripped))
|
||||||
$stripped .= "&offset=".urlencode($a->page_offset);
|
$stripped .= "&offset=".urlencode($a->page_offset);
|
||||||
if (!strpos($stripped, "?")) {
|
|
||||||
if ($pos = strpos($stripped, "&"))
|
|
||||||
$stripped = substr($stripped, 0, $pos)."?".substr($stripped, $pos + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
$url = $a->get_baseurl() . '/' . $stripped;
|
$url = $a->get_baseurl() . '/' . $stripped;
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
function _l(&$d, $name, $url, $text, $class="") {
|
function _l(&$d, $name, $url, $text, $class="") {
|
||||||
|
if (!strpos($url, "?")) {
|
||||||
|
if ($pos = strpos($url, "&"))
|
||||||
|
$url = substr($url, 0, $pos)."?".substr($url, $pos + 1);
|
||||||
|
}
|
||||||
|
|
||||||
$d[$name] = array('url'=>$url, 'text'=>$text, 'class'=>$class);
|
$d[$name] = array('url'=>$url, 'text'=>$text, 'class'=>$class);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue