Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix offset not in array if on last page and filter is applied.
Browse files Browse the repository at this point in the history
thibsy authored and thojou committed Jan 10, 2025
1 parent 0f89ab4 commit 93a7971
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/ILIAS/Data/src/Range.php
Original file line number Diff line number Diff line change
@@ -102,7 +102,7 @@ public function croppedTo(int $max): Range
}

if ($this->getStart() > $max) {
return new self($max, 0);
return new self(0, min($max, $this->getLength()));
}

return $this->withLength($max - $this->getStart());
Original file line number Diff line number Diff line change
@@ -215,7 +215,7 @@ protected function findCurrentPage(array $ranges, int $offset): int
return $idx;
}
}
throw new LogicException('offset is not in any range');
return 0;
}

/**

0 comments on commit 93a7971

Please sign in to comment.