mirror of
https://github.com/openvk/openvk
synced 2024-12-22 16:42:32 +03:00
Restrict search to authorized users and add ratelimit
Searching is heavy, additional measures to prevent abuse must be taken.
This commit is contained in:
parent
0cd75a5a3d
commit
3281cd0c1b
1 changed files with 4 additions and 0 deletions
|
@ -25,6 +25,10 @@ final class SearchPresenter extends OpenVKPresenter
|
|||
$type = $this->queryParam("type") ?? "users";
|
||||
$page = (int) ($this->queryParam("p") ?? 1);
|
||||
|
||||
$this->willExecuteWriteAction();
|
||||
if($query != "")
|
||||
$this->assertUserLoggedIn();
|
||||
|
||||
// https://youtu.be/pSAWM5YuXx8
|
||||
|
||||
$repos = [ "groups" => "clubs", "users" => "users" ];
|
||||
|
|
Loading…
Reference in a new issue