Skip to content

Commit

Permalink
Add offset out of bounds exception
Browse files Browse the repository at this point in the history
  • Loading branch information
misagh authored May 10, 2022
1 parent c4c265b commit 39a9e27
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/SphinxSE.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ public function setServer($host, $port = 0)
*/
public function setLimits($offset, $limit, $max = 1000, $cutoff = 0)
{
if ($offset >= $max)
{
throw new SphinxSEException('Offset out of bounds exception.');
}

$this->offset = $offset;
$this->limit = $limit;
$this->maxmatches = $max;
Expand Down

0 comments on commit 39a9e27

Please sign in to comment.