Skip to content

Commit

Permalink
fixed parameter which is in limit and offset, at the time of less tha…
Browse files Browse the repository at this point in the history
…n 1.(fixes #2233)
  • Loading branch information
touri committed Sep 12, 2011
1 parent c5d1609 commit 86011c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/api/opAPI.class.php
Expand Up @@ -157,9 +157,9 @@ public function setOffsetAndLimitation()
$this->getQuery()->setHydrationMode(Doctrine::HYDRATE_RECORD);

$maxResults = $this->getParameter('max-results', 25);
$this->query->limit((is_numeric($maxResults) && 1 <= $maxResults) ? $maxResults : 25);
$this->query->limit((is_numeric($maxResults) && 1 < $maxResults) ? $maxResults : 25);
$start = $this->getParameter('start', 1);
$this->query->offset((is_numeric($start) && 1<= $start) ? $start - 1 : 0);
$this->query->offset((is_numeric($start) && 1< $start) ? $start - 1 : 0);

return $this;
}
Expand Down

0 comments on commit 86011c2

Please sign in to comment.