Skip to content

Commit

Permalink
- Some fix into Paginator component for order / sort classic sintax
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasferreira committed May 26, 2017
1 parent 57ddc24 commit b539161
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Cake/Controller/Component/PaginatorComponent.php
Expand Up @@ -382,13 +382,13 @@ public function validateSort(Model $object, array $options, array $whitelist = a
}
return $options;
}

if (!empty($options['order']) && is_array($options['order'])) {
$order = array();
foreach ($options['order'] as $key => $value) {
if (is_int($key)) {
$key = $value;
$value = 'asc';
$field = explode(' ', $value);
$key = $field[0];
$value = count($field) === 2 ? trim($field[1]) : 'asc';
}
$field = $key;
$alias = $object->alias;
Expand Down

0 comments on commit b539161

Please sign in to comment.