From bed5d3f1499921fe2e1593dd8b724ccb3b392378 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 5 May 2023 15:16:36 +0300 Subject: [PATCH] fix offset out of bounds error --- library/sphinxql.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/sphinxql.php b/library/sphinxql.php index 0e27362..ea4bf72 100644 --- a/library/sphinxql.php +++ b/library/sphinxql.php @@ -21,9 +21,9 @@ class SphinxQL { ORDER BY `rank` DESC, WEIGHT() DESC - LIMIT ' . (int) ($start > $maxMatches ? ($maxMatches > 0 ? $maxMatches - 1 : 0) : $start) . ',' . (int) $limit . ' + LIMIT ' . (int) ($start >= $maxMatches ? ($maxMatches > 0 ? $maxMatches - 1 : 0) : $start) . ',' . (int) $limit . ' - OPTION `max_matches`=' . (int) ($maxMatches > 1 ? $maxMatches : 1)); + OPTION `max_matches`=' . (int) ($maxMatches >= 1 ? $maxMatches : 1)); $query->execute([$keyword]); @@ -40,9 +40,9 @@ class SphinxQL { ORDER BY `rank` DESC, WEIGHT() DESC - LIMIT ' . (int) ($start > $maxMatches ? ($maxMatches > 0 ? $maxMatches - 1 : 0) : $start) . ',' . (int) $limit . ' + LIMIT ' . (int) ($start >= $maxMatches ? ($maxMatches > 0 ? $maxMatches - 1 : 0) : $start) . ',' . (int) $limit . ' - OPTION `max_matches`=' . (int) ($maxMatches > 1 ? $maxMatches : 1)); + OPTION `max_matches`=' . (int) ($maxMatches >= 1 ? $maxMatches : 1)); $query->execute([$keyword]);