Skip to content

Commit

Permalink
(fixes #2233) replace is_numeric to ctype_digit for check number
Browse files Browse the repository at this point in the history
  • Loading branch information
y-watanabe committed Sep 21, 2011
1 parent 17c947d commit d797b71
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((ctype_digit((string)$maxResults) && 1 <= $maxResults) ? $maxResults : 25);
$start = $this->getParameter('start', 1);
$this->query->offset((is_numeric($start) && 1 <= $start) ? $start - 1 : 0);
$this->query->offset((ctype_digit((string)$start) && 1 <= $start) ? $start - 1 : 0);

return $this;
}
Expand Down

0 comments on commit d797b71

Please sign in to comment.