diff --git a/lib/Cake/Controller/Component/PaginatorComponent.php b/lib/Cake/Controller/Component/PaginatorComponent.php index 6e34fa6d7..85f8ab6b0 100644 --- a/lib/Cake/Controller/Component/PaginatorComponent.php +++ b/lib/Cake/Controller/Component/PaginatorComponent.php @@ -382,13 +382,13 @@ class PaginatorComponent extends Component { } 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;