mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
Restrict maximum posts per page to 50 in global and local feed
This commit is contained in:
parent
e50aa27eeb
commit
65e4c163cb
1 changed files with 2 additions and 2 deletions
|
@ -86,7 +86,7 @@ final class WallPresenter extends OpenVKPresenter
|
||||||
}, iterator_to_array($subs));
|
}, iterator_to_array($subs));
|
||||||
$ids[] = $this->user->id;
|
$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()
|
$posts = DatabaseConnection::i()
|
||||||
->getContext()
|
->getContext()
|
||||||
->table("posts")
|
->table("posts")
|
||||||
|
@ -110,7 +110,7 @@ final class WallPresenter extends OpenVKPresenter
|
||||||
$this->assertUserLoggedIn();
|
$this->assertUserLoggedIn();
|
||||||
|
|
||||||
$page = (int) ($_GET["p"] ?? 1);
|
$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()
|
$posts = DatabaseConnection::i()
|
||||||
->getContext()
|
->getContext()
|
||||||
->table("posts")
|
->table("posts")
|
||||||
|
|
Loading…
Reference in a new issue