diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index 9267e9241..a25b924d8 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -423,7 +423,6 @@ class PaginatorHelper extends AppHelper { function numbers($options = array()) { $options = am( array( - 'url' => array(), 'before'=> null, 'after'=> null, 'model' => $this->defaultModel(), @@ -463,29 +462,30 @@ class PaginatorHelper extends AppHelper { $end = $params['page'] + ($modulus - $params['page']) + 1; } for ($i = $start; $i < $params['page']; $i++) { - $out .= $this->link($i, am($options['url'], array('page' => $i)), $options) . $separator; + $out .= $this->link($i, array('page' => $i), $options) . $separator; } $out .= $params['page'] . $separator; $start = $params['page'] + 1; for ($i = $start; $i < $end; $i++) { - $out .= $this->link($i, am($options['url'], array('page' => $i)), $options) . $separator; + $out .= $this->link($i, array('page' => $i), $options) . $separator; + } + + if ($end != $params['page']) { + $out .= $this->link($i, array('page' => $end), $options); } - $out .= $this->link($i, am($options['url'], array('page' => $end)), $options); - } else { - for ($i = 1; $i < $params['pageCount']; $i++) { + for ($i = 1; $i <= $params['pageCount']; $i++) { if ($i == $params['page']) { $out .= $i . $separator; } else { - $out .= $this->link($i, am($options['url'], array('page' => $i)), $options) . $separator; + $out .= $this->link($i, array('page' => $i), $options) . $separator; } } - $out .= $this->link($i, am($options['url'], array('page' => $params['pageCount'])), $options); } $out .= $after; return $this->output($out); } } -?> \ No newline at end of file +?>