[ci skip] Merge pull request #5342 from aanbar/pagination-bc-fix
Preserve attributes from pagination config files
Related: #4454
diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php
index f26f8a4..ece4eda 100644
--- a/system/libraries/Pagination.php
+++ b/system/libraries/Pagination.php
@@ -339,6 +339,8 @@
}
}
+ // Enable rel attribute by default
+ isset($params['attributes']) OR $params['attributes'] = array();
$this->initialize($params);
log_message('info', 'Pagination Class Initialized');
}
@@ -353,8 +355,7 @@
*/
public function initialize(array $params = array())
{
- isset($params['attributes']) OR $params['attributes'] = array();
- if (is_array($params['attributes']))
+ if (isset($params['attributes']) && is_array($params['attributes']))
{
$this->_parse_attributes($params['attributes']);
unset($params['attributes']);