Restrict maximum posts per page to 50 in global and local feed

This commit is contained in:
Linus Torvalds 2020-08-25 15:44:06 +00:00
parent e50aa27eeb
commit 65e4c163cb

View file

@ -86,7 +86,7 @@ final class WallPresenter extends OpenVKPresenter
}, iterator_to_array($subs));
$ids[] = $this->user->id;
$perPage = (int) ($_GET["posts"] ?? OPENVK_DEFAULT_PER_PAGE);
$perPage = min((int) ($_GET["posts"] ?? OPENVK_DEFAULT_PER_PAGE), 50);
$posts = DatabaseConnection::i()
->getContext()
->table("posts")
@ -110,7 +110,7 @@ final class WallPresenter extends OpenVKPresenter
$this->assertUserLoggedIn();
$page = (int) ($_GET["p"] ?? 1);
$pPage = (int) ($_GET["posts"] ?? OPENVK_DEFAULT_PER_PAGE);
$pPage = min((int) ($_GET["posts"] ?? OPENVK_DEFAULT_PER_PAGE), 50);
$posts = DatabaseConnection::i()
->getContext()
->table("posts")