Skip to content

Commit

Permalink
Simplify whitelist logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jul 16, 2013
1 parent d4db64f commit a8f4ec0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/Cake/Controller/Component/PaginatorComponent.php
Expand Up @@ -377,11 +377,8 @@ public function validateSort(Model $object, array $options, array $whitelist = a
$inWhitelist = in_array($field, $whitelist, true);
if (!$inWhitelist) {
$options['order'] = null;
return $options;
}
if ($inWhitelist) {
return $options;
}
return $options;
}

if (!empty($options['order']) && is_array($options['order'])) {
Expand Down

0 comments on commit a8f4ec0

Please sign in to comment.