Fix errors generated when option['order'] is undefined.

Fixes #2447
This commit is contained in:
mark_story 2012-01-08 21:55:51 -05:00
parent 3c48552f81
commit f4c27e04bc
2 changed files with 21 additions and 1 deletions

View file

@ -333,7 +333,7 @@ class PaginatorComponent extends Component {
$options['order'] = array($options['sort'] => $direction);
}
if (!empty($whitelist)) {
if (!empty($whitelist) && isset($options['order']) && is_array($options['order'])) {
$field = key($options['order']);
if (!in_array($field, $whitelist)) {
$options['order'] = null;