do not display page:1 or ?page=1 to avoid duplicate content in paginator helper output

This commit is contained in:
euromark 2013-07-17 00:45:27 +02:00
parent 532b2099e5
commit 05415dd83f
2 changed files with 80 additions and 67 deletions

View file

@ -427,7 +427,12 @@ class PaginatorHelper extends AppHelper {
$url = array_merge($url, compact('sort', 'direction'));
}
$url = $this->_convertUrlKeys($url, $paging['paramType']);
if (!empty($url['page']) && $url['page'] == 1) {
unset($url['page']);
}
if (!empty($url['?']['page']) && $url['?']['page'] == 1) {
unset($url['?']['page']);
}
if ($asArray) {
return $url;
}