diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index a3d948462..be521d68f 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -311,10 +311,7 @@ class PaginatorHelper extends AppHelper { if ($this->{$check}()) { return $this->link($title, $url, array_merge($options, array('escape' => $escape))); } else { - if ($escape) { - $title = h($title); - } - return sprintf('%s', $this->_parseAttributes($options), $title); + return $this->Html->div(null, $title, $options, $escape); } } /** diff --git a/cake/tests/cases/libs/view/helpers/paginator.test.php b/cake/tests/cases/libs/view/helpers/paginator.test.php index 8815cebb8..2de80b130 100644 --- a/cake/tests/cases/libs/view/helpers/paginator.test.php +++ b/cake/tests/cases/libs/view/helpers/paginator.test.php @@ -85,12 +85,12 @@ class PaginatorTest extends UnitTestCase { $this->Paginator->params['paging']['Article']['nextPage'] = false; $this->Paginator->params['paging']['Article']['page'] = 1; $result = $this->Paginator->next('Next', array(), true); - $expected = 'Next'; + $expected = '
Next
'; $this->assertEqual($result, $expected); $this->Paginator->params['paging']['Article']['prevPage'] = false; $result = $this->Paginator->prev('prev', array('update'=> 'theList', 'indicator'=> 'loading', 'url'=> array('controller' => 'posts')), null, array('class' => 'disabled')); - $expected = 'prev'; + $expected = '
prev
'; $this->assertEqual($result, $expected); } @@ -202,7 +202,7 @@ class PaginatorTest extends UnitTestCase { 'options' => array('page' => 1, 'limit' => 3, 'order' => array('Client.name' => 'DESC'), 'conditions' => array())) ); $result = $this->Paginator->prev('<< Previous', null, null, array('class' => 'disabled')); - $expected = '<< Previous'; + $expected = '
<< Previous
'; $this->assertEqual($result, $expected); $this->Paginator->params['paging']['Client']['page'] = 2;