Skip to content

Commit

Permalink
Fix options['order'] also being vulnerable to injection attacks.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jun 25, 2013
1 parent f2c9639 commit 51beab4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cake/libs/controller/controller.php
Expand Up @@ -1114,6 +1114,11 @@ function paginate($object = null, $scope = array(), $whitelist = array()) {
$options['limit'] = $options['show'];
}

if (isset($options['order']) && empty($options['sort'])) {
$options['sort'] = $options['order'];
unset($options['order']);
}

if (isset($options['sort'])) {
$direction = null;
if (isset($options['direction'])) {
Expand Down

0 comments on commit 51beab4

Please sign in to comment.