From 39a9e275d9913c67972b6fbedbe1b31c5b67620c Mon Sep 17 00:00:00 2001 From: Misagh Laghaei Date: Tue, 10 May 2022 17:23:58 +0100 Subject: [PATCH] Add offset out of bounds exception --- src/SphinxSE.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/SphinxSE.php b/src/SphinxSE.php index 1231c83..8106802 100644 --- a/src/SphinxSE.php +++ b/src/SphinxSE.php @@ -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;