From ffed3d109e25756c4de2116b09d34c4c92d9b61c Mon Sep 17 00:00:00 2001 From: Dhruv Date: Sat, 20 Apr 2013 19:26:01 +0530 Subject: [PATCH] [ticket/11437] avoid $start becoming negative when no search results are found When search returns no results there is no need to go inside the if statement. Since $result_count becomes zero, $start becomes negative which leads to failed assertion. PHPBB3-11437 --- phpBB/includes/search/fulltext_sphinx.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php index 63e35eb4af..889324bbda 100644 --- a/phpBB/includes/search/fulltext_sphinx.php +++ b/phpBB/includes/search/fulltext_sphinx.php @@ -611,7 +611,7 @@ class phpbb_search_fulltext_sphinx $result_count = $result['total_found']; - if ($start >= $result_count) + if ($result_count && $start >= $result_count) { $start = floor(($result_count - 1) / $per_page) * $per_page;