]> git.mxchange.org Git - friendica.git/blobdiff - src/BaseDepository.php
Move FSuggest to depository
[friendica.git] / src / BaseDepository.php
index 18cca9d30e2c4baa1d9f8048b9988dfa45b12603..75118dd8cbf1645668a99c4b3de55ddc53dde24e 100644 (file)
@@ -13,7 +13,7 @@ use Psr\Log\LoggerInterface;
  * Depositories are meant to store and retrieve Entities from the database.
  *
  * The reason why there are methods prefixed with an underscore is because PHP doesn't support generic polymorphism
- * which means we can't direcly overload base methods and make parameters more strict (from a parent class to a child
+ * which means we can't directly overload base methods and make parameters more strict (from a parent class to a child
  * class for example)
  *
  * Similarly, we can't make an overloaded method return type more strict until we only support PHP version 7.4 but this
@@ -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;