]> git.mxchange.org Git - friendica.git/commitdiff
Ignore max_id when it's 0 or less in BaseDepository->_selectByBoundaries
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 13 Oct 2021 01:18:23 +0000 (21:18 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 13 Oct 2021 01:18:32 +0000 (21:18 -0400)
- It can cause a conflict when both min_id and max_id = 0 as default values

src/BaseDepository.php

index 69bd93eef584d709c9cd3386365b36bca999dfbb..75118dd8cbf1645668a99c4b3de55ddc53dde24e 100644 (file)
@@ -87,7 +87,7 @@ abstract class BaseDepository
                        }
                }
 
-               if (isset($max_id)) {
+               if (isset($max_id) && $max_id > 0) {
                        $boundCondition = DBA::mergeConditions($boundCondition, ['`id` < ?', $max_id]);
                        if (!isset($min_id) && (!isset($params['order']['id']) || $params['order']['id'] === false || $params['order']['id'] === 'ASC')) {
                                $reverseOrder = true;