Skip to content
Permalink
Browse files

Add some todo's so I don't forget.

  • Loading branch information...
markstory committed Nov 19, 2013
1 parent 9d5b832 commit 0856b597e36703975963fc3c84d22b5d613f6520
Showing with 7 additions and 0 deletions.
  1. +7 −0 Cake/Controller/Component/PaginatorComponent.php
@@ -142,6 +142,9 @@ public function paginate($object, $settings = array(), $whitelist = array()) {
$alias = $object->alias();
$options = $this->mergeOptions($alias, $settings);
// TODO perhaps move this until after the query has been created.
// Then we could look at the fields in the query.
$options = $this->validateSort($object, $options, $whitelist);
$options = $this->checkLimit($options);
@@ -177,6 +180,8 @@ public function paginate($object, $settings = array(), $whitelist = array()) {
$parameters = compact('conditions', 'fields', 'order', 'limit', 'page');
$query = $object->find($type, array_merge($parameters, $extra));
// TODO Validate sort and apply them here.
$results = $query->execute();
$numResults = count($results);
@@ -310,6 +315,8 @@ public function validateSort(Table $object, array $options, array $whitelist = a
if (!empty($options['order']) && is_array($options['order'])) {
$tableAlias = $object->alias();
$order = array();
// TODO Remove associated field checks and rely on the whitelist.
foreach ($options['order'] as $key => $value) {
$field = $key;
$alias = $tableAlias;

0 comments on commit 0856b59

Please sign in to comment.
You can’t perform that action at this time.